Passed
Pull Request — master (#102)
by Sébastien
03:51
created
src/Karma/Command/ConfigureActionCommand.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -30,6 +30,11 @@  discard block
 block discarded – undo
30 30
     protected
31 31
         $environment;
32 32
 
33
+    /**
34
+     * @param string $name
35
+     * @param string $description
36
+     * @param string $outputTitle
37
+     */
33 38
     public function __construct(Application $app, $name, $description, $outputTitle)
34 39
     {
35 40
         $this->name = $name;
@@ -128,6 +133,10 @@  discard block
 block discarded – undo
128 133
     }
129 134
 
130 135
     abstract protected function launchConfigurationAction(ConfigurableProcessor $processor);
136
+
137
+    /**
138
+     * @return ConfigurableProcessor
139
+     */
131 140
     abstract protected function getProcessor();
132 141
 
133 142
     private function configureProcessor(ConfigurableProcessor $processor)
@@ -153,6 +162,9 @@  discard block
 block discarded – undo
153 162
         }
154 163
     }
155 164
 
165
+    /**
166
+     * @param string $optionName
167
+     */
156 168
     private function parseOptionWithAssignments(InputInterface $input, $optionName)
157 169
     {
158 170
         $strings = $input->getOption($optionName);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $sourcePath = $profile->getSourcePath();
105 105
         }
106 106
 
107
-        if(! is_array($sourcePath))
107
+        if( ! is_array($sourcePath))
108 108
         {
109 109
             $sourcePath = array($sourcePath);
110 110
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $strings = $input->getOption($optionName);
159 159
 
160
-        if(! is_array($strings))
160
+        if( ! is_array($strings))
161 161
         {
162 162
             $strings = array($strings);
163 163
         }
Please login to merge, or discard this patch.
src/Karma/Configuration/Parser.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -199,6 +199,9 @@
 block discarded – undo
199 199
         return $sectionName;
200 200
     }
201 201
 
202
+    /**
203
+     * @param string $sectionName
204
+     */
202 205
     private function switchSectionParser($sectionName)
203 206
     {
204 207
         if(! isset($this->parsers[$sectionName]))
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function enableIncludeSupport()
51 51
     {
52
-        if(! isset($this->parsers[self::INCLUDES]))
52
+        if( ! isset($this->parsers[self::INCLUDES]))
53 53
         {
54 54
             $this->parsers[self::INCLUDES] = new IncludeParser();
55 55
         }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
     public function enableExternalSupport()
61 61
     {
62
-        if(! isset($this->parsers[self::EXTERNALS]))
62
+        if( ! isset($this->parsers[self::EXTERNALS]))
63 63
         {
64 64
             $this->parsers[self::EXTERNALS] = new ExternalParser(new Parser($this->fs));
65 65
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function enableGroupSupport()
71 71
     {
72
-        if(! isset($this->parsers[self::GROUPS]))
72
+        if( ! isset($this->parsers[self::GROUPS]))
73 73
         {
74 74
             $this->parsers[self::GROUPS] = new GroupParser();
75 75
         }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         $files = array($masterFilePath);
103 103
 
104
-        while(! empty($files))
104
+        while( ! empty($files))
105 105
         {
106 106
             foreach($files as $file)
107 107
             {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function extractLines($filePath)
153 153
     {
154
-        if(! $this->fs->has($filePath))
154
+        if( ! $this->fs->has($filePath))
155 155
         {
156 156
             throw new \RuntimeException("$filePath does not exist");
157 157
         }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
     private function switchSectionParser($sectionName)
203 203
     {
204
-        if(! isset($this->parsers[$sectionName]))
204
+        if( ! isset($this->parsers[$sectionName]))
205 205
         {
206 206
             throw new \RuntimeException('Unknown section name ' . $sectionName);
207 207
         }
Please login to merge, or discard this patch.
src/Karma/Configuration/ValueFilterIterator.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -14,6 +14,9 @@
 block discarded – undo
14 14
         $isRegex,
15 15
         $filter;
16 16
 
17
+    /**
18
+     * @param string $filter
19
+     */
17 20
     public function __construct($filter, \Iterator $iterator)
18 21
     {
19 22
         parent::__construct($iterator);
Please login to merge, or discard this patch.
src/Karma/Command/Diff.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         $table->enableFormattingTags()
46 46
             ->setHeaders(array($environment1, $environment2))
47 47
             ->displayKeys()
48
-            ->setValueRenderingFunction(function($value){
48
+            ->setValueRenderingFunction(function($value) {
49 49
                 return $this->formatValue($value);
50 50
             });
51 51
 
Please login to merge, or discard this patch.
src/Karma/Command/Hydrate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $unusedVariables = $processor->getUnusedVariables();
36 36
 
37
-        if(! empty($unusedVariables))
37
+        if( ! empty($unusedVariables))
38 38
         {
39 39
             $logger = $this->app['logger'];
40 40
 
41
-            $logger->warning('You have unused variables : you should remove them or check if you have not mispelled them').
41
+            $logger->warning('You have unused variables : you should remove them or check if you have not mispelled them') .
42 42
             $logger->warning(sprintf(
43 43
                 'Unused variables : %s',
44 44
                 implode(', ', $unusedVariables)
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $unvaluedVariables = $processor->getUnvaluedVariables();
52 52
 
53
-        if(! empty($unvaluedVariables))
53
+        if( ! empty($unvaluedVariables))
54 54
         {
55 55
             $logger = $this->app['logger'];
56 56
 
Please login to merge, or discard this patch.
src/Karma/Configuration/FilterInputVariable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
     {
9 9
         if(is_array($value))
10 10
         {
11
-            return array_map(function ($item) {
11
+            return array_map(function($item) {
12 12
                 return $this->filterOneValue($item);
13 13
             }, $value);
14 14
         }
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
     private function filterOneValue($value)
20 20
     {
21
-        if(! is_string($value))
21
+        if( ! is_string($value))
22 22
         {
23 23
             return $value;
24 24
         }
Please login to merge, or discard this patch.
src/Karma/Configuration/InMemoryReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     public function getAllVariables()
44 44
     {
45
-        $variables = array_map(function($key){
45
+        $variables = array_map(function($key) {
46 46
             return $this->extractVariableName($key);
47 47
         }, array_keys($this->values));
48 48
 
Please login to merge, or discard this patch.
src/Karma/Configuration/Parser/GroupParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     private function hasDuplicatedValues(array $values)
106 106
     {
107
-        $duplicatedValues = array_filter(array_count_values($values), function ($counter) {
107
+        $duplicatedValues = array_filter(array_count_values($values), function($counter) {
108 108
             return $counter !== 1;
109 109
         });
110 110
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         $errors = array_intersect($allEnvironments, array_keys($this->groups));
152 152
 
153
-        if(! empty($errors))
153
+        if( ! empty($errors))
154 154
         {
155 155
             throw new \RuntimeException(sprintf(
156 156
                'Error : a group can not be part of another group (%s)',
Please login to merge, or discard this patch.
src/Karma/Configuration/Parser/IncludeParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     private function checkFilenameIsValid($filename)
28 28
     {
29
-        if(! preg_match('~.*\.conf$~', $filename))
29
+        if( ! preg_match('~.*\.conf$~', $filename))
30 30
         {
31 31
             $this->triggerError("$filename is not a valid file name", 'Invalid dependency');
32 32
         }
Please login to merge, or discard this patch.