Completed
Pull Request — master (#671)
by Antonio
02:59
created
src/ClassDiscovery/RelativeNamespaceDiscovery.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
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
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public function testGetClasses()
14 14
     {
15 15
         $classLoader = new ClassLoader();
16
-        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]);
16
+        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]);
17 17
         $service = new RelativeNamespaceDiscovery($classLoader);
18 18
         $service->setRelativeNamespace('Robo\Plugin');
19 19
         $classes = $service->getClasses();
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function testGetFile()
26 26
     {
27 27
         $classLoader = new ClassLoader();
28
-        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]);
28
+        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]);
29 29
         $service = new RelativeNamespaceDiscovery($classLoader);
30 30
         $service->setRelativeNamespace('Robo\Plugin');
31 31
 
Please login to merge, or discard this patch.
src/Runner.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function __construct($roboClass = null, $roboFile = null)
64 64
     {
65 65
         // set the const as class properties to allow overwriting in child classes
66
-        $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS ;
66
+        $this->roboClass = $roboClass ? $roboClass : self::ROBOCLASS;
67 67
         $this->roboFile  = $roboFile ? $roboFile : self::ROBOFILE;
68 68
         $this->dir = getcwd();
69 69
     }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     {
240 240
         /** @var \Robo\ClassDiscovery\RelativeNamespaceDiscovery $discovery */
241 241
         $discovery = Robo::service('relativeNamespaceDiscovery');
242
-        $discovery->setRelativeNamespace($relativeNamespace.'\Commands');
242
+        $discovery->setRelativeNamespace($relativeNamespace . '\Commands');
243 243
         return $discovery->getClasses();
244 244
     }
245 245
 
@@ -412,9 +412,9 @@  discard block
 block discarded – undo
412 412
 
413 413
         if (substr($argv[$pos], 0, 12) == '--load-from=') {
414 414
             $this->dir = substr($argv[$pos], 12);
415
-        } elseif (isset($argv[$pos +1])) {
416
-            $this->dir = $argv[$pos +1];
417
-            unset($argv[$pos +1]);
415
+        } elseif (isset($argv[$pos + 1])) {
416
+            $this->dir = $argv[$pos + 1];
417
+            unset($argv[$pos + 1]);
418 418
         }
419 419
         unset($argv[$pos]);
420 420
         // Make adjustments if '--load-from' points at a file.
Please login to merge, or discard this patch.