@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | public function testGetClasses() |
| 12 | 12 | { |
| 13 | 13 | $service = $this->getServiceInstance('\Commands'); |
| 14 | - $service->getClassLoader()->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]); |
|
| 14 | + $service->getClassLoader()->addPsr4('\\Robo\\', [realpath(__DIR__ . '/../../src')]); |
|
| 15 | 15 | |
| 16 | 16 | $classes = $service->getClasses(); |
| 17 | 17 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public function testGetFile() |
| 23 | 23 | { |
| 24 | 24 | $service = $this->getServiceInstance('\Commands'); |
| 25 | - $service->getClassLoader()->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]); |
|
| 25 | + $service->getClassLoader()->addPsr4('\\Robo\\', [realpath(__DIR__ . '/../../src')]); |
|
| 26 | 26 | |
| 27 | 27 | $actual = $service->getFile('\Robo\Commands\FirstCustomCommands'); |
| 28 | 28 | $this->assertStringEndsWith('tests/src/Commands/FirstCustomCommands.php', $actual); |
@@ -41,18 +41,18 @@ discard block |
||
| 41 | 41 | $relativePath = $this->convertNamespaceToPath($this->relativeNamespace); |
| 42 | 42 | |
| 43 | 43 | foreach ($this->getClassLoader()->getPrefixesPsr4() as $baseNamespace => $directories) { |
| 44 | - $directories = array_map(function ($directory) use ($relativePath) { |
|
| 45 | - return $directory.$relativePath; |
|
| 44 | + $directories = array_map(function($directory) use ($relativePath) { |
|
| 45 | + return $directory . $relativePath; |
|
| 46 | 46 | }, $directories); |
| 47 | 47 | |
| 48 | - $directories = array_filter($directories, function ($path) { |
|
| 48 | + $directories = array_filter($directories, function($path) { |
|
| 49 | 49 | return is_dir($path); |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | 52 | if ($directories) { |
| 53 | 53 | foreach ($this->search($directories, $this->searchPattern) as $file) { |
| 54 | 54 | $relativePathName = $file->getRelativePathname(); |
| 55 | - $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.DIRECTORY_SEPARATOR.$relativePathName); |
|
| 55 | + $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . DIRECTORY_SEPARATOR . $relativePathName); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -99,6 +99,6 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function convertNamespaceToPath($namespace) |
| 101 | 101 | { |
| 102 | - return DIRECTORY_SEPARATOR.str_replace("\\", DIRECTORY_SEPARATOR, trim($namespace, '\\')); |
|
| 102 | + return DIRECTORY_SEPARATOR . str_replace("\\", DIRECTORY_SEPARATOR, trim($namespace, '\\')); |
|
| 103 | 103 | } |
| 104 | 104 | } |