Completed
Pull Request — master (#671)
by Antonio
03:11
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
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public function testGetClasses()
12 12
     {
13 13
         $classLoader = new ClassLoader();
14
-        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__.'/../../plugins')]);
14
+        $classLoader->addPsr4('\\Robo\\PluginTest\\', [realpath(__DIR__ . '/../../plugins')]);
15 15
         $service = new RelativeNamespaceDiscovery($classLoader);
16 16
         $service->setRelativeNamespace('Robo\Plugin');
17 17
         $service->setSearchPattern('*Commands.php');
@@ -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
             ->setSearchPattern('*Commands.php');
244 244
         return $discovery->getClasses();
245 245
     }
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
 
414 414
         if (substr($argv[$pos], 0, 12) == '--load-from=') {
415 415
             $this->dir = substr($argv[$pos], 12);
416
-        } elseif (isset($argv[$pos +1])) {
417
-            $this->dir = $argv[$pos +1];
418
-            unset($argv[$pos +1]);
416
+        } elseif (isset($argv[$pos + 1])) {
417
+            $this->dir = $argv[$pos + 1];
418
+            unset($argv[$pos + 1]);
419 419
         }
420 420
         unset($argv[$pos]);
421 421
         // Make adjustments if '--load-from' points at a file.
Please login to merge, or discard this patch.