@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function getCachedServicesPath(): string |
14 | 14 | { |
15 | - return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->basePath('storage/app/') . 'services.php'); |
|
15 | + return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->basePath('storage/app/').'services.php'); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function createField($column, $attributes, $type = 'add') |
148 | 148 | { |
149 | - $results = "\t\t\t" . '$table'; |
|
149 | + $results = "\t\t\t".'$table'; |
|
150 | 150 | |
151 | 151 | foreach ($attributes as $key => $field) { |
152 | 152 | if (in_array($column, $this->relationshipKeys)) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - return $results . ';' . PHP_EOL; |
|
159 | + return $results.';'.PHP_EOL; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | protected function addRelationColumn($key, $field, $column) |
172 | 172 | { |
173 | 173 | if ($key === 0) { |
174 | - $relatedColumn = Str::snake(class_basename($field)) . '_id'; |
|
174 | + $relatedColumn = Str::snake(class_basename($field)).'_id'; |
|
175 | 175 | |
176 | - return "->integer('{$relatedColumn}')->unsigned();" . PHP_EOL . "\t\t\t" . "\$table->foreign('{$relatedColumn}')"; |
|
176 | + return "->integer('{$relatedColumn}')->unsigned();".PHP_EOL."\t\t\t"."\$table->foreign('{$relatedColumn}')"; |
|
177 | 177 | } |
178 | 178 | if ($key === 1) { |
179 | 179 | return "->references('{$field}')"; |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | return "->on('{$field}')"; |
183 | 183 | } |
184 | 184 | if (Str::contains($field, '(')) { |
185 | - return '->' . $field; |
|
185 | + return '->'.$field; |
|
186 | 186 | } |
187 | - return '->' . $field . '()'; |
|
187 | + return '->'.$field.'()'; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -199,18 +199,18 @@ discard block |
||
199 | 199 | protected function addColumn($key, $field, $column) |
200 | 200 | { |
201 | 201 | if ($this->hasCustomAttribute($column)) { |
202 | - return '->' . $field; |
|
202 | + return '->'.$field; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | if ($key == 0) { |
206 | - return '->' . $field . "('" . $column . "')"; |
|
206 | + return '->'.$field."('".$column."')"; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | if (Str::contains($field, '(')) { |
210 | - return '->' . $field; |
|
210 | + return '->'.$field; |
|
211 | 211 | } |
212 | 212 | |
213 | - return '->' . $field . '()'; |
|
213 | + return '->'.$field.'()'; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | protected function removeColumn($key, $field, $column) |
226 | 226 | { |
227 | 227 | if ($this->hasCustomAttribute($column)) { |
228 | - return '->' . $field; |
|
228 | + return '->'.$field; |
|
229 | 229 | } |
230 | 230 | |
231 | - return '->dropColumn(' . "'" . $column . "')"; |
|
231 | + return '->dropColumn('."'".$column."')"; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | */ |
254 | 254 | public function getAttributes($column, $schema) |
255 | 255 | { |
256 | - $fields = str_replace($column . ':', '', $schema); |
|
256 | + $fields = str_replace($column.':', '', $schema); |
|
257 | 257 | |
258 | 258 | return $this->hasCustomAttribute($column) ? $this->getCustomAttribute($column) : explode(':', $fields); |
259 | 259 | } |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function getEventName(Module $module) |
79 | 79 | { |
80 | - $namespace = $this->laravel['modules']->config('namespace') . "\\" . $module->getStudlyName(); |
|
80 | + $namespace = $this->laravel['modules']->config('namespace')."\\".$module->getStudlyName(); |
|
81 | 81 | $eventPath = GenerateConfigReader::read('event'); |
82 | 82 | |
83 | - $eventName = $namespace . "\\" . $eventPath->getPath() . "\\" . $this->option('event'); |
|
83 | + $eventName = $namespace."\\".$eventPath->getPath()."\\".$this->option('event'); |
|
84 | 84 | |
85 | 85 | return str_replace('/', '\\', $eventName); |
86 | 86 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $listenerPath = GenerateConfigReader::read('listener'); |
93 | 93 | |
94 | - return $path . $listenerPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
94 | + return $path.$listenerPath->getPath().'/'.$this->getFileName().'.php'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -18,10 +18,10 @@ |
||
18 | 18 | // This checks if we are running on a Laravel Vapor managed instance |
19 | 19 | // and sets the path to a writable one (services path is not on a writable storage in Vapor). |
20 | 20 | if (!is_null(env('VAPOR_MAINTENANCE_MODE', null))) { |
21 | - return Str::replaceLast('config.php', $this->getSnakeName() . '_module.php', $this->app->getCachedConfigPath()); |
|
21 | + return Str::replaceLast('config.php', $this->getSnakeName().'_module.php', $this->app->getCachedConfigPath()); |
|
22 | 22 | } |
23 | 23 | |
24 | - return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath()); |
|
24 | + return Str::replaceLast('services.php', $this->getSnakeName().'_module.php', $this->app->getCachedServicesPath()); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -76,10 +76,10 @@ |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * Get module type . |
|
80 | - * |
|
81 | - * @return string |
|
82 | - */ |
|
79 | + * Get module type . |
|
80 | + * |
|
81 | + * @return string |
|
82 | + */ |
|
83 | 83 | private function getModuleType() |
84 | 84 | { |
85 | 85 | $isPlain = $this->option('plain'); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
64 | 64 | $factoryPath = GenerateConfigReader::read('component-view'); |
65 | 65 | |
66 | - return $path . $factoryPath->getPath() . '/' . $this->getFileName(); |
|
66 | + return $path.$factoryPath->getPath().'/'.$this->getFileName(); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | */ |
72 | 72 | private function getFileName() |
73 | 73 | { |
74 | - return Str::lower($this->argument('name')) . '.blade.php'; |
|
74 | + return Str::lower($this->argument('name')).'.blade.php'; |
|
75 | 75 | } |
76 | 76 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->setupStubPath(); |
27 | 27 | $this->registerProviders(); |
28 | 28 | |
29 | - $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'modules'); |
|
29 | + $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'modules'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function setupStubPath() |
36 | 36 | { |
37 | - $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__ . '/Commands/stubs'; |
|
37 | + $path = $this->app['config']->get('modules.stubs.path') ?? __DIR__.'/Commands/stubs'; |
|
38 | 38 | Stub::setBasePath($path); |
39 | 39 | |
40 | - $this->app->booted(function ($app) { |
|
40 | + $this->app->booted(function($app) { |
|
41 | 41 | /** @var RepositoryInterface $moduleRepository */ |
42 | 42 | $moduleRepository = $app[RepositoryInterface::class]; |
43 | 43 | if ($moduleRepository->config('stubs.enabled') === true) { |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | */ |
52 | 52 | protected function registerServices() |
53 | 53 | { |
54 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
54 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
55 | 55 | $path = $app['config']->get('modules.paths.modules'); |
56 | 56 | |
57 | 57 | return new Laravel\LaravelFileRepository($app, $path); |
58 | 58 | }); |
59 | - $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
59 | + $this->app->singleton(Contracts\ActivatorInterface::class, function($app) { |
|
60 | 60 | $activator = $app['config']->get('modules.activator'); |
61 | - $class = $app['config']->get('modules.activators.' . $activator)['class']; |
|
61 | + $class = $app['config']->get('modules.activators.'.$activator)['class']; |
|
62 | 62 | |
63 | 63 | if ($class === null) { |
64 | 64 | throw InvalidActivatorClass::missingConfig(); |
@@ -36,8 +36,8 @@ |
||
36 | 36 | */ |
37 | 37 | protected function registerNamespaces() |
38 | 38 | { |
39 | - $configPath = __DIR__ . '/../config/config.php'; |
|
40 | - $stubsPath = dirname(__DIR__) . '/src/Commands/stubs'; |
|
39 | + $configPath = __DIR__.'/../config/config.php'; |
|
40 | + $stubsPath = dirname(__DIR__).'/src/Commands/stubs'; |
|
41 | 41 | |
42 | 42 | $this->publishes([ |
43 | 43 | $configPath => config_path('modules.php'), |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | $lowerName = $this->getLowerName(); |
205 | 205 | |
206 | - $langPath = $this->getPath() . '/Resources/lang'; |
|
206 | + $langPath = $this->getPath().'/Resources/lang'; |
|
207 | 207 | |
208 | 208 | if (is_dir($langPath)) { |
209 | 209 | $this->loadTranslationsFrom($langPath, $lowerName); |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | $file = 'module.json'; |
224 | 224 | } |
225 | 225 | |
226 | - return Arr::get($this->moduleJson, $file, function () use ($file) { |
|
227 | - return $this->moduleJson[$file] = new Json($this->getPath() . '/' . $file, $this->files); |
|
226 | + return Arr::get($this->moduleJson, $file, function() use ($file) { |
|
227 | + return $this->moduleJson[$file] = new Json($this->getPath().'/'.$file, $this->files); |
|
228 | 228 | }); |
229 | 229 | } |
230 | 230 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | protected function fireEvent($event): void |
279 | 279 | { |
280 | - $this->app['events']->dispatch(sprintf('modules.%s.' . $event, $this->getLowerName()), [$this]); |
|
280 | + $this->app['events']->dispatch(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]); |
|
281 | 281 | } |
282 | 282 | /** |
283 | 283 | * Register the aliases from this module. |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | protected function registerFiles(): void |
303 | 303 | { |
304 | 304 | foreach ($this->get('files', []) as $file) { |
305 | - include $this->path . '/' . $file; |
|
305 | + include $this->path.'/'.$file; |
|
306 | 306 | } |
307 | 307 | } |
308 | 308 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function getExtraPath(string $path): string |
409 | 409 | { |
410 | - return $this->getPath() . '/' . $path; |
|
410 | + return $this->getPath().'/'.$path; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |