Completed
Pull Request — master (#671)
by Antonio
05:59
created
src/Runner.php 1 patch
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
         $this->dir = getcwd();
64 64
     }
65 65
 
66
+    /**
67
+     * @param string $errorType
68
+     */
66 69
     protected function errorCondtion($msg, $errorType)
67 70
     {
68 71
         $this->errorConditions[$msg] = $errorType;
@@ -110,7 +113,7 @@  discard block
 block discarded – undo
110 113
     }
111 114
 
112 115
     /**
113
-     * @param array $argv
116
+     * @param string[] $argv
114 117
      * @param null|string $appName
115 118
      * @param null|string $appVersion
116 119
      * @param null|\Symfony\Component\Console\Output\OutputInterface $output
@@ -133,7 +136,7 @@  discard block
 block discarded – undo
133 136
      * @param null|\Symfony\Component\Console\Input\InputInterface $input
134 137
      * @param null|\Symfony\Component\Console\Output\OutputInterface $output
135 138
      * @param null|\Robo\Application $app
136
-     * @param array[] $commandFiles
139
+     * @param null|string $commandFiles
137 140
      * @param null|ClassLoader $classLoader
138 141
      *
139 142
      * @return int
Please login to merge, or discard this patch.
tests/unit/ClassDiscovery/RelativeNamespaceDiscoveryTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function testGetClasses()
12 12
     {
13 13
         $classLoader = new ClassLoader();
14
-        $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__.'/../../src')]);
14
+        $classLoader->addPsr4('\\Robo\\', [realpath(__DIR__ . '/../../src')]);
15 15
 
16 16
         $discovery = new RelativeNamespaceDiscovery('\Commands');
17 17
         $discovery->setClassLoader($classLoader);
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -67,6 +67,10 @@
 block discarded – undo
67 67
         ];
68 68
     }
69 69
 
70
+    /**
71
+     * @param RelativeNamespaceDiscovery $object
72
+     * @param string $method
73
+     */
70 74
     function callProtected($object, $method, $args = [])
71 75
     {
72 76
         $r = new \ReflectionMethod($object, $method);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
     public function testConvertPathToNamespaceData()
39 39
     {
40 40
         return [
41
-          ['/A/B/C', 'A\B\C'],
42
-          ['A/B/C', 'A\B\C'],
43
-          ['A/B/C', 'A\B\C'],
44
-          ['A/B/C.php', 'A\B\C'],
41
+            ['/A/B/C', 'A\B\C'],
42
+            ['A/B/C', 'A\B\C'],
43
+            ['A/B/C', 'A\B\C'],
44
+            ['A/B/C.php', 'A\B\C'],
45 45
         ];
46 46
     }
47 47
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
     public function testConvertNamespaceToPathData()
62 62
     {
63 63
         return [
64
-          ['A\B\C', '/A/B/C'],
65
-          ['\A\B\C\\', '/A/B/C'],
66
-          ['A\B\C\\', '/A/B/C'],
64
+            ['A\B\C', '/A/B/C'],
65
+            ['\A\B\C\\', '/A/B/C'],
66
+            ['A\B\C\\', '/A/B/C'],
67 67
         ];
68 68
     }
69 69
 
Please login to merge, or discard this patch.
src/ClassDiscovery/RelativeNamespaceDiscovery.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,8 @@
 block discarded – undo
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
     }
Please login to merge, or discard this 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($relativePathName);
60
+                $classes[] = $baseNamespace . $this->convertPathToNamespace($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.