@@ -36,23 +36,23 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function scanDirectories(): array |
| 38 | 38 | { |
| 39 | - $bootstrap = []; |
|
| 39 | + $bootstrap = [ ]; |
|
| 40 | 40 | $modules = \Module::all(); |
| 41 | 41 | |
| 42 | 42 | foreach ($modules as $module) { |
| 43 | 43 | foreach ($this->moduleEntityDirectories as $directory) { |
| 44 | 44 | $directory = ucfirst($directory); |
| 45 | - $directoryPath = $module->getPath() . '/' . $directory; |
|
| 46 | - $namespace = 'Modules' . '\\' . $module->getName(); |
|
| 45 | + $directoryPath = $module->getPath().'/'.$directory; |
|
| 46 | + $namespace = 'Modules'.'\\'.$module->getName(); |
|
| 47 | 47 | if (file_exists($directoryPath)) { |
| 48 | 48 | $files = scandir($directoryPath); |
| 49 | 49 | foreach ($files as $fileName) { |
| 50 | 50 | if ($this->isPhpFile($fileName)) { |
| 51 | 51 | $className = basename($fileName, '.php'); |
| 52 | - $class = $namespace . '\\' . $directory . '\\' . $className; |
|
| 52 | + $class = $namespace.'\\'.$directory.'\\'.$className; |
|
| 53 | 53 | try { |
| 54 | 54 | if (new $class() instanceof Command) { |
| 55 | - $bootstrap['commands'][] = $class; |
|
| 55 | + $bootstrap[ 'commands' ][ ] = $class; |
|
| 56 | 56 | } |
| 57 | 57 | } catch (\Exception $e) { |
| 58 | 58 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | private function isPhpFile(string $fileName): bool |
| 69 | 69 | { |
| 70 | - return strlen($fileName) > 5 && '.php' === ($fileName[-4] . $fileName[-3] . $fileName[-2] . $fileName[-1]); |
|
| 70 | + return strlen($fileName) > 5 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | private function loadBootstrapFromCache() |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function getCommands(): array |
| 84 | 84 | { |
| 85 | - return $this->loadBootstrapFromCache()['commands']; |
|
| 85 | + return $this->loadBootstrapFromCache()[ 'commands' ]; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function getCachePath(): string |
| 89 | 89 | { |
| 90 | - return app()->bootstrapPath() . '/cache/' . $this->cacheFile; |
|
| 90 | + return app()->bootstrapPath().'/cache/'.$this->cacheFile; |
|
| 91 | 91 | } |
| 92 | 92 | } |