@@ -31,7 +31,7 @@ |
||
31 | 31 | ->setConsole($this) |
32 | 32 | ->setForce($this->option('force')) |
33 | 33 | ->setPlain($this->option('plain')) |
34 | - ->setActive(! $this->option('disabled')) |
|
34 | + ->setActive(!$this->option('disabled')) |
|
35 | 35 | ->generate(); |
36 | 36 | } |
37 | 37 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | Stub::setBasePath(__DIR__ . '/Commands/stubs'); |
30 | 30 | |
31 | - $this->app->booted(static function ($app) { |
|
31 | + $this->app->booted(static function($app) { |
|
32 | 32 | /** @var \Rawilk\LaravelModules\Contracts\Repository $moduleRepository */ |
33 | 33 | $moduleRepository = $app[Repository::class]; |
34 | 34 | |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | |
41 | 41 | protected function registerServices(): void |
42 | 42 | { |
43 | - $this->app->singleton(Repository::class, static function ($app) { |
|
43 | + $this->app->singleton(Repository::class, static function($app) { |
|
44 | 44 | $path = $app['config']->get('modules.paths.modules'); |
45 | 45 | |
46 | 46 | return new LaravelFileRepository($app, $path); |
47 | 47 | }); |
48 | 48 | |
49 | - $this->app->singleton(Activator::class, static function ($app) { |
|
49 | + $this->app->singleton(Activator::class, static function($app) { |
|
50 | 50 | $activator = $app['config']->get('modules.activator'); |
51 | 51 | $class = $app['config']->get('modules.activators.' . $activator)['class']; |
52 | 52 |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('config_path')) { |
|
3 | +if (!function_exists('config_path')) { |
|
4 | 4 | function config_path(string $path = ''): string |
5 | 5 | { |
6 | 6 | return app()->basePath() . '/config' . ($path ? "/{$path}" : $path); |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | -if (! function_exists('module_path')) { |
|
10 | +if (!function_exists('module_path')) { |
|
11 | 11 | function module_path(string $name): string |
12 | 12 | { |
13 | 13 | /** @var \Rawilk\LaravelModules\Module $module */ |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if (! function_exists('public_path')) { |
|
20 | +if (!function_exists('public_path')) { |
|
21 | 21 | function public_path(string $path = ''): string |
22 | 22 | { |
23 | 23 | return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path); |
@@ -70,17 +70,17 @@ |
||
70 | 70 | |
71 | 71 | public function publish(): void |
72 | 72 | { |
73 | - if (! $this->console instanceof Command) { |
|
73 | + if (!$this->console instanceof Command) { |
|
74 | 74 | $message = "The 'console' property must be an instance of " . Command::class . '.'; |
75 | 75 | |
76 | 76 | throw new RuntimeException($message); |
77 | 77 | } |
78 | 78 | |
79 | - if (! $this->getFilesystem()->isDirectory($sourcePath = $this->getSourcePath())) { |
|
79 | + if (!$this->getFilesystem()->isDirectory($sourcePath = $this->getSourcePath())) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - if (! $this->getFilesystem()->isDirectory($destinationPath = $this->getDestinationPath())) { |
|
83 | + if (!$this->getFilesystem()->isDirectory($destinationPath = $this->getDestinationPath())) { |
|
84 | 84 | $this->getFilesystem()->makeDirectory($destinationPath, 0775, true); |
85 | 85 | } |
86 | 86 |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | return $this->cache->remember( |
57 | 57 | $this->moduleCacheKey($module->getName()), |
58 | 58 | $this->cacheLifetime, |
59 | - function () use ($module, $status) { |
|
59 | + function() use ($module, $status) { |
|
60 | 60 | $databaseModule = $this->model::findModule($module->getName()); |
61 | 61 | |
62 | - if (! $databaseModule) { |
|
62 | + if (!$databaseModule) { |
|
63 | 63 | return $status === false; |
64 | 64 | } |
65 | 65 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function reset(): void |
72 | 72 | { |
73 | 73 | $this->model::allModules() |
74 | - ->each(function (ModuleModel $module) { |
|
74 | + ->each(function(ModuleModel $module) { |
|
75 | 75 | $this->flushCache($module->getName()); |
76 | 76 | }); |
77 | 77 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function delete(Module $module): void |
47 | 47 | { |
48 | - if (! isset($this->moduleStatuses[$module->getName()])) { |
|
48 | + if (!isset($this->moduleStatuses[$module->getName()])) { |
|
49 | 49 | return; |
50 | 50 | } |
51 | 51 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public function hasStatus(Module $module, bool $status): bool |
75 | 75 | { |
76 | - if (! isset($this->moduleStatuses[$module->getName()])) { |
|
76 | + if (!isset($this->moduleStatuses[$module->getName()])) { |
|
77 | 77 | return $status === false; |
78 | 78 | } |
79 | 79 | |
@@ -117,18 +117,18 @@ discard block |
||
117 | 117 | |
118 | 118 | private function getModulesStatuses(): array |
119 | 119 | { |
120 | - if (! $this->config->get('modules.cache.enabled')) { |
|
120 | + if (!$this->config->get('modules.cache.enabled')) { |
|
121 | 121 | return $this->readJson(); |
122 | 122 | } |
123 | 123 | |
124 | - return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function () { |
|
124 | + return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function() { |
|
125 | 125 | return $this->readJson(); |
126 | 126 | }); |
127 | 127 | } |
128 | 128 | |
129 | 129 | private function readJson(): array |
130 | 130 | { |
131 | - if (! $this->files->exists($this->statusesFile)) { |
|
131 | + if (!$this->files->exists($this->statusesFile)) { |
|
132 | 132 | return []; |
133 | 133 | } |
134 | 134 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $concatenatedPackages .= "\"{$name}:{$version}\" "; |
48 | 48 | } |
49 | 49 | |
50 | - if (! empty($concatenatedPackages)) { |
|
50 | + if (!empty($concatenatedPackages)) { |
|
51 | 51 | $this->run("composer require --dev {$concatenatedPackages}"); |
52 | 52 | } |
53 | 53 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $concatenatedPackages .= "\"{$name}:{$version}\" "; |
64 | 64 | } |
65 | 65 | |
66 | - if (! empty($concatenatedPackages)) { |
|
66 | + if (!empty($concatenatedPackages)) { |
|
67 | 67 | $this->run("composer require {$concatenatedPackages}"); |
68 | 68 | } |
69 | 69 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function publishMigrations(): void |
22 | 22 | { |
23 | - if (! class_exists('CreateModulesTable')) { |
|
23 | + if (!class_exists('CreateModulesTable')) { |
|
24 | 24 | $this->publishes([ |
25 | 25 | __DIR__ . '/../database/migrations/create_modules_table.php.stub' => database_path('migrations/' . date('Y_m_d_His') . '_create_modules_table.php') |
26 | 26 | ], 'migrations'); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function toArray(): array |
16 | 16 | { |
17 | - return array_map(static function ($value) { |
|
17 | + return array_map(static function($value) { |
|
18 | 18 | if ($value instanceof Module) { |
19 | 19 | $attributes = $value->json()->getAttributes(); |
20 | 20 | $attributes['path'] = $value->getPath(); |