@@ -39,11 +39,11 @@ |
||
39 | 39 | |
40 | 40 | public function getDestinationFilePath() |
41 | 41 | { |
42 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
42 | + $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
43 | 43 | |
44 | 44 | $eventPath = GenerateConfigReader::read('event'); |
45 | 45 | |
46 | - return $path . $eventPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
46 | + return $path.$eventPath->getPath().'/'.$this->getFileName().'.php'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $testPath = GenerateConfigReader::read('test-unit'); |
81 | 81 | } |
82 | 82 | |
83 | - return $path . $testPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
83 | + return $path.$testPath->getPath().'/'.$this->getFileName().'.php'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -24,21 +24,21 @@ discard block |
||
24 | 24 | { |
25 | 25 | $module = $this->getModuleModel($name); |
26 | 26 | |
27 | - $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
27 | + $this->components->task("Updating Composer.json <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
28 | 28 | |
29 | - $composer_path = $module->getPath() . DIRECTORY_SEPARATOR . 'composer.json'; |
|
29 | + $composer_path = $module->getPath().DIRECTORY_SEPARATOR.'composer.json'; |
|
30 | 30 | |
31 | 31 | $composer = json_decode(File::get($composer_path), true); |
32 | 32 | |
33 | 33 | $autoload = data_get($composer, 'autoload.psr-4'); |
34 | 34 | |
35 | - if (! $autoload) { |
|
35 | + if (!$autoload) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | 39 | $key_name_with_app = sprintf('Modules\\%s\\App\\', $module->getStudlyName()); |
40 | 40 | |
41 | - if (! array_key_exists($key_name_with_app, $autoload)) { |
|
41 | + if (!array_key_exists($key_name_with_app, $autoload)) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | }); |
54 | 54 | } |
55 | 55 | |
56 | - public function getInfo(): string|null |
|
56 | + public function getInfo(): string | null |
|
57 | 57 | { |
58 | 58 | return 'Updating Composer.json of modules...'; |
59 | 59 | } |
@@ -22,12 +22,12 @@ |
||
22 | 22 | { |
23 | 23 | $module = $this->getModuleModel($name); |
24 | 24 | |
25 | - $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
25 | + $this->components->task("Updating <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
26 | 26 | $this->laravel['modules']->update($module); |
27 | 27 | }); |
28 | 28 | } |
29 | 29 | |
30 | - public function getInfo(): string|null |
|
30 | + public function getInfo(): string | null |
|
31 | 31 | { |
32 | 32 | return 'Updating Module ...'; |
33 | 33 | } |
@@ -33,12 +33,12 @@ |
||
33 | 33 | ? '<fg=red;options=bold>Disabled</>' |
34 | 34 | : '<fg=green;options=bold>Enabled</>'; |
35 | 35 | |
36 | - $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function () use ($module) { |
|
36 | + $this->components->task("Disabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function() use ($module) { |
|
37 | 37 | $module->disable(); |
38 | 38 | }); |
39 | 39 | } |
40 | 40 | |
41 | - public function getInfo(): string|null |
|
41 | + public function getInfo(): string | null |
|
42 | 42 | { |
43 | 43 | return 'Disabling module ...'; |
44 | 44 | } |
@@ -22,12 +22,12 @@ |
||
22 | 22 | { |
23 | 23 | $module = $this->getModuleModel($name); |
24 | 24 | |
25 | - $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
25 | + $this->components->task("Using <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
26 | 26 | $this->laravel['modules']->setUsed($module); |
27 | 27 | }); |
28 | 28 | } |
29 | 29 | |
30 | - public function getInfo(): string|null |
|
30 | + public function getInfo(): string | null |
|
31 | 31 | { |
32 | 32 | return 'Using Module ...'; |
33 | 33 | } |
@@ -24,12 +24,12 @@ |
||
24 | 24 | { |
25 | 25 | $module = $this->getModuleModel($name); |
26 | 26 | |
27 | - $this->components->task("Forget Using <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
27 | + $this->components->task("Forget Using <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
28 | 28 | $this->laravel['modules']->forgetUsed($module); |
29 | 29 | }); |
30 | 30 | } |
31 | 31 | |
32 | - public function getInfo(): string|null |
|
32 | + public function getInfo(): string | null |
|
33 | 33 | { |
34 | 34 | return 'Forget Using Module ...'; |
35 | 35 | } |
@@ -26,12 +26,12 @@ |
||
26 | 26 | ? '<fg=red;options=bold>Disabled</>' |
27 | 27 | : '<fg=green;options=bold>Enabled</>'; |
28 | 28 | |
29 | - $this->components->task("Enabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function () use ($module) { |
|
29 | + $this->components->task("Enabling <fg=cyan;options=bold>{$module->getName()}</> Module, old status: $status", function() use ($module) { |
|
30 | 30 | $module->enable(); |
31 | 31 | }); |
32 | 32 | } |
33 | 33 | |
34 | - public function getInfo(): string|null |
|
34 | + public function getInfo(): string | null |
|
35 | 35 | { |
36 | 36 | return 'Disabling module ...'; |
37 | 37 | } |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected function models(): Collection |
75 | 75 | { |
76 | - if (! empty($models = $this->option('model'))) { |
|
77 | - return collect($models)->filter(function ($model) { |
|
76 | + if (!empty($models = $this->option('model'))) { |
|
77 | + return collect($models)->filter(function($model) { |
|
78 | 78 | return class_exists($model); |
79 | 79 | })->values(); |
80 | 80 | } |
81 | 81 | |
82 | 82 | $except = $this->option('except'); |
83 | 83 | |
84 | - if (! empty($models) && ! empty($except)) { |
|
84 | + if (!empty($models) && !empty($except)) { |
|
85 | 85 | throw new InvalidArgumentException('The --models and --except options cannot be combined.'); |
86 | 86 | } |
87 | 87 | |
@@ -101,23 +101,23 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | return collect(Finder::create()->in($path)->files()->name('*.php')) |
104 | - ->map(function ($model) { |
|
104 | + ->map(function($model) { |
|
105 | 105 | |
106 | 106 | $namespace = config('modules.namespace'); |
107 | 107 | |
108 | - return $namespace . str_replace( |
|
108 | + return $namespace.str_replace( |
|
109 | 109 | ['/', '.php'], |
110 | 110 | ['\\', ''], |
111 | 111 | Str::after($model->getRealPath(), realpath(config('modules.paths.modules'))) |
112 | 112 | ); |
113 | 113 | })->values() |
114 | - ->when(! empty($except), function ($models) use ($except) { |
|
115 | - return $models->reject(function ($model) use ($except) { |
|
114 | + ->when(!empty($except), function($models) use ($except) { |
|
115 | + return $models->reject(function($model) use ($except) { |
|
116 | 116 | return in_array($model, $except); |
117 | 117 | }); |
118 | - })->filter(function ($model) { |
|
118 | + })->filter(function($model) { |
|
119 | 119 | return class_exists($model); |
120 | - })->filter(function ($model) { |
|
120 | + })->filter(function($model) { |
|
121 | 121 | return $this->isPrunable($model); |
122 | 122 | })->values(); |
123 | 123 | } |