Completed
Pull Request — master (#671)
by Antonio
02:53
created
src/ClassDiscovery/RelativeNamespaceDiscovery.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
         $relativePath = $this->convertNamespaceToPath($this->relativeNamespace);
48 48
 
49 49
         foreach ($this->getClassLoader()->getPrefixesPsr4() as $baseNamespace => $directories) {
50
-            $directories = array_map(function ($directory) use ($relativePath) {
51
-                return $directory.$relativePath;
50
+            $directories = array_map(function($directory) use ($relativePath) {
51
+                return $directory . $relativePath;
52 52
             }, $directories);
53 53
 
54
-            $directories = array_filter($directories, function ($path) {
54
+            $directories = array_filter($directories, function($path) {
55 55
                 return is_dir($path);
56 56
             });
57 57
 
58 58
             foreach ($this->search($directories, $this->searchPattern) as $file) {
59 59
                 $relativePathName = $file->getRelativePathname();
60
-                $classes[] = $baseNamespace.$this->convertPathToNamespace($relativePath.DIRECTORY_SEPARATOR.$relativePathName);
60
+                $classes[] = $baseNamespace . $this->convertPathToNamespace($relativePath . DIRECTORY_SEPARATOR . $relativePathName);
61 61
             }
62 62
         }
63 63
 
@@ -103,6 +103,6 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function convertNamespaceToPath($namespace)
105 105
     {
106
-        return DIRECTORY_SEPARATOR.str_replace("\\", DIRECTORY_SEPARATOR, trim($namespace, '\\'));
106
+        return DIRECTORY_SEPARATOR . str_replace("\\", DIRECTORY_SEPARATOR, trim($namespace, '\\'));
107 107
     }
108 108
 }
Please login to merge, or discard this patch.
tests/unit/ClassDiscovery/RelativeNamespaceDiscoveryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.