@@ -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 | } |
@@ -22,14 +22,14 @@ |
||
22 | 22 | { |
23 | 23 | $module = $this->getModuleModel($name); |
24 | 24 | |
25 | - $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
25 | + $this->components->task("Generating for <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
26 | 26 | chdir($module->getPath()); |
27 | 27 | |
28 | 28 | passthru('composer dump -o -n -q'); |
29 | 29 | }); |
30 | 30 | } |
31 | 31 | |
32 | - public function getInfo(): string|null |
|
32 | + public function getInfo(): string | null |
|
33 | 33 | { |
34 | 34 | return 'Generating optimized autoload modules'; |
35 | 35 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $database = $this->option('database'); |
34 | 34 | |
35 | - if (! empty($database)) { |
|
35 | + if (!empty($database)) { |
|
36 | 36 | $migrator->setDatabase($database); |
37 | 37 | } |
38 | 38 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | if (count($migrated)) { |
42 | 42 | foreach ($migrated as $migration) { |
43 | - $this->components->task("Rollback: <info>{$migration}</info>", ); |
|
43 | + $this->components->task("Rollback: <info>{$migration}</info>",); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | } |
52 | 52 | |
53 | - public function getInfo(): string|null |
|
53 | + public function getInfo(): string | null |
|
54 | 54 | { |
55 | 55 | return null; |
56 | 56 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | ]); |
39 | 39 | } |
40 | 40 | |
41 | - public function getInfo(): string|null |
|
41 | + public function getInfo(): string | null |
|
42 | 42 | { |
43 | 43 | return null; |
44 | 44 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $database = $this->option('database'); |
34 | 34 | |
35 | - if (! empty($database)) { |
|
35 | + if (!empty($database)) { |
|
36 | 36 | $migrator->setDatabase($database); |
37 | 37 | } |
38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->components->warn("Nothing to rollback on module <fg=cyan;options=bold>{$module->getName()}</>"); |
50 | 50 | } |
51 | 51 | |
52 | - public function getInfo(): string|null |
|
52 | + public function getInfo(): string | null |
|
53 | 53 | { |
54 | 54 | return null; |
55 | 55 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $contents = $this->getTemplateContents(); |
44 | 44 | |
45 | 45 | try { |
46 | - $this->components->task("Generating file {$path}", function () use ($path, $contents) { |
|
46 | + $this->components->task("Generating file {$path}", function() use ($path, $contents) { |
|
47 | 47 | $overwriteFile = $this->hasOption('force') ? $this->option('force') : false; |
48 | 48 | (new FileGenerator($path, $contents))->withFileOverwrite($overwriteFile)->generate(); |
49 | 49 | }); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | |
93 | 93 | $namespace = $this->laravel['modules']->config('namespace'); |
94 | 94 | |
95 | - $namespace .= '\\' . $module->getStudlyName(); |
|
95 | + $namespace .= '\\'.$module->getStudlyName(); |
|
96 | 96 | |
97 | - $namespace .= '\\' . $this->getDefaultNamespace(); |
|
97 | + $namespace .= '\\'.$this->getDefaultNamespace(); |
|
98 | 98 | |
99 | - $namespace .= '\\' . $extra; |
|
99 | + $namespace .= '\\'.$extra; |
|
100 | 100 | |
101 | 101 | $namespace = str_replace('/', '\\', $namespace); |
102 | 102 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | ]); |
31 | 31 | } |
32 | 32 | |
33 | - public function getInfo(): string|null |
|
33 | + public function getInfo(): string | null |
|
34 | 34 | { |
35 | 35 | return 'Publishing module config files ...'; |
36 | 36 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $module = $this->getModuleModel($name); |
28 | 28 | |
29 | - $this->components->task("Publishing Migration <fg=cyan;options=bold>{$module->getName()}</> Module", function () use ($module) { |
|
29 | + $this->components->task("Publishing Migration <fg=cyan;options=bold>{$module->getName()}</> Module", function() use ($module) { |
|
30 | 30 | with(new MigrationPublisher(new Migrator($module, $this->getLaravel()))) |
31 | 31 | ->setRepository($this->laravel['modules']) |
32 | 32 | ->setConsole($this) |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | }); |
35 | 35 | } |
36 | 36 | |
37 | - public function getInfo(): string|null |
|
37 | + public function getInfo(): string | null |
|
38 | 38 | { |
39 | 39 | return 'Publishing module migrations ...'; |
40 | 40 | } |