Passed
Push — master ( b3b4c7...2fd2da )
by Arthur
24:27
created

GeneratorManager::createFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 10.03.19
6
 * Time: 18:30
7
 */
8
9
namespace Foundation\Generator\Managers;
10
11
12
class GeneratorManager
13
{
14
    public static function createMigration(string $moduleName, string $migrationName, string $tableName, bool $mongo = false)
15
    {
16
        $options = [
17
            "module" => $moduleName,
18
            "name" => $migrationName,
19
            "--table" => $tableName,
20
            "--mongo" => $mongo
21
        ];
22
        \Artisan::call("larapi:make:migration", $options);
23
    }
24
25
    public static function createController(string $moduleName, string $controllerName)
26
    {
27
        $options = [
28
            "module" => $moduleName,
29
            "name" => $controllerName,
30
        ];
31
        \Artisan::call("larapi:make:controller", $options);
32
    }
33
34
    public static function createEvent(string $moduleName, string $eventName)
35
    {
36
        $options = [
37
            "module" => $moduleName,
38
            "name" => $eventName,
39
        ];
40
        \Artisan::call("larapi:make:event", $options);
41
    }
42
43
    public static function createNotification(string $moduleName, string $notificationName)
44
    {
45
        $options = [
46
            "module" => $moduleName,
47
            "name" => $notificationName,
48
        ];
49
        \Artisan::call("larapi:make:notification", $options);
50
    }
51
52
    public static function createServiceProvider(string $moduleName, string $providerName)
53
    {
54
        $options = [
55
            "module" => $moduleName,
56
            "name" => $providerName,
57
        ];
58
        \Artisan::call("larapi:make:provider", $options);
59
    }
60
61
    public static function createMiddleware(string $moduleName, string $middlewareName)
62
    {
63
        $options = [
64
            "module" => $moduleName,
65
            "name" => $middlewareName,
66
        ];
67
        \Artisan::call("larapi:make:middleware", $options);
68
    }
69
70
    public static function createFactory(string $moduleName, string $modelName)
71
    {
72
        $options = [
73
            "module" => $moduleName,
74
            "--model" => $modelName,
75
        ];
76
        \Artisan::call("larapi:make:factory", $options);
77
    }
78
79
    public static function createListener(string $moduleName, string $listenerName, string $eventName, bool $queued = false)
80
    {
81
        $options = [
82
            "module" => $moduleName,
83
            "name" => $listenerName,
84
            "--event" => $eventName,
85
            "--queued" => $queued
86
        ];
87
        \Artisan::call("larapi:make:listener", $options);
88
    }
89
90
    public static function createJob(string $moduleName, string $jobName, bool $sync = false)
91
    {
92
        $options = [
93
            "module" => $moduleName,
94
            "name" => $jobName,
95
            "--sync" => $sync
96
        ];
97
        \Artisan::call("larapi:make:job", $options);
98
    }
99
100
    public static function createCommand(string $moduleName, string $jobName, string $commandName = null)
101
    {
102
        $options = [
103
            "module" => $moduleName,
104
            "name" => $jobName,
105
            "--command" => $commandName
106
        ];
107
        \Artisan::call("larapi:make:command", $options);
108
    }
109
}
110