@@ -91,8 +91,8 @@ |
||
| 91 | 91 | { |
| 92 | 92 | $finder = new Finder(); |
| 93 | 93 | $finder->files() |
| 94 | - ->name($pattern) |
|
| 95 | - ->in($directories); |
|
| 94 | + ->name($pattern) |
|
| 95 | + ->in($directories); |
|
| 96 | 96 | |
| 97 | 97 | return $finder; |
| 98 | 98 | } |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | $relativePath = $this->convertNamespaceToPath($this->relativeNamespace); |
| 54 | 54 | |
| 55 | 55 | foreach ($this->classLoader->getPrefixesPsr4() as $baseNamespace => $directories) { |
| 56 | - $directories = array_filter(array_map(function ($directory) use ($relativePath) { |
|
| 57 | - return $directory.$relativePath; |
|
| 56 | + $directories = array_filter(array_map(function($directory) use ($relativePath) { |
|
| 57 | + return $directory . $relativePath; |
|
| 58 | 58 | }, $directories), 'is_dir'); |
| 59 | 59 | |
| 60 | 60 | if ($directories) { |
| 61 | 61 | foreach ($this->search($directories, $this->searchPattern) as $file) { |
| 62 | 62 | $relativePathName = $file->getRelativePathname(); |
| 63 | - $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.'/'.$relativePathName); |
|
| 63 | + $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . '/' . $relativePathName); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -107,6 +107,6 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function convertNamespaceToPath($namespace) |
| 109 | 109 | { |
| 110 | - return '/'.str_replace("\\", '/', trim($namespace, '\\')); |
|
| 110 | + return '/' . str_replace("\\", '/', trim($namespace, '\\')); |
|
| 111 | 111 | } |
| 112 | 112 | } |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | public function testConvertPathToNamespaceData() |
| 48 | 48 | { |
| 49 | 49 | return [ |
| 50 | - ['/A/B/C', $this->normalizePath('A\B\C')], |
|
| 51 | - ['A/B/C', $this->normalizePath('A\B\C')], |
|
| 52 | - ['A/B/C', $this->normalizePath('A\B\C')], |
|
| 53 | - ['A/B/C.php', $this->normalizePath('A\B\C')], |
|
| 50 | + ['/A/B/C', $this->normalizePath('A\B\C')], |
|
| 51 | + ['A/B/C', $this->normalizePath('A\B\C')], |
|
| 52 | + ['A/B/C', $this->normalizePath('A\B\C')], |
|
| 53 | + ['A/B/C.php', $this->normalizePath('A\B\C')], |
|
| 54 | 54 | ]; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | public function testConvertNamespaceToPathData() |
| 71 | 71 | { |
| 72 | 72 | return [ |
| 73 | - ['A\B\C', $this->normalizePath('/A/B/C')], |
|
| 74 | - ['\A\B\C\\', $this->normalizePath('/A/B/C')], |
|
| 75 | - ['A\B\C\\', $this->normalizePath('/A/B/C')], |
|
| 73 | + ['A\B\C', $this->normalizePath('/A/B/C')], |
|
| 74 | + ['\A\B\C\\', $this->normalizePath('/A/B/C')], |
|
| 75 | + ['A\B\C\\', $this->normalizePath('/A/B/C')], |
|
| 76 | 76 | ]; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function testGetClasses() |
| 14 | 14 | { |
| 15 | 15 | $classLoader = new ClassLoader(); |
| 16 | - $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]); |
|
| 16 | + $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__ . '/../../src')]); |
|
| 17 | 17 | $service = new RelativeNamespaceDiscovery($classLoader); |
| 18 | 18 | $service->setRelativeNamespace('\Commands'); |
| 19 | 19 | $classes = $service->getClasses(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function testGetFile() |
| 26 | 26 | { |
| 27 | 27 | $classLoader = new ClassLoader(); |
| 28 | - $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]); |
|
| 28 | + $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__ . '/../../src')]); |
|
| 29 | 29 | $service = new RelativeNamespaceDiscovery($classLoader); |
| 30 | 30 | $service->setRelativeNamespace('\Commands'); |
| 31 | 31 | |