Completed
Branch master (5d3c49)
by Peter
02:52
created
src/GitPolicy/Application/GitPolicyAnalyser.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace GitPolicy\Application;
4 4
 
5 5
 use Symfony\Component\Console\Application;
6
-use Symfony\Component\Console\Input;
7 6
 use Symfony\Component\Console\Input\InputDefinition;
8 7
 use Symfony\Component\Console\Input\InputOption;
9 8
 use Symfony\Component\Console\Input\InputInterface;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -116,9 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         return
118 118
             // no intention to process anything else than tags and branches for now ;)
119
-            !(in_array($push['context']['ref_type'], ['tag', 'branch'])) ? [] :
120
-
121
-            // get the right section of the config for this
119
+            !(in_array($push['context']['ref_type'], ['tag', 'branch'])) ? [] : // get the right section of the config for this
122 120
             (array_key_exists($push['context']['ref_type'], $config)) ? $config[$push['context']['ref_type']] : [];
123 121
     }
124 122
 
@@ -142,7 +140,7 @@  discard block
 block discarded – undo
142 140
             !array_key_exists('forbidden', $config) ? [] : array_intersect_key(
143 141
                 // remove the elements which aren't applicable
144 142
                 $config['forbidden'],
145
-                array_filter($push['context']['is'], function ($state) { return $state; })
143
+                array_filter($push['context']['is'], function($state) { return $state; })
146 144
             ),
147 145
 
148 146
             // Should the name be validated?
@@ -154,14 +152,14 @@  discard block
 block discarded – undo
154 152
                 // check if the forbidden patterns brings any messages
155 153
                 !isset($config['name']['forbidden_patterns']) ? [] : array_keys(array_filter(
156 154
                     array_flip($config['name']['forbidden_patterns']),
157
-                    function ($pattern) use ($push) { return preg_match($pattern, $push['context']['ref_name']); }
155
+                    function($pattern) use ($push) { return preg_match($pattern, $push['context']['ref_name']); }
158 156
                 )),
159 157
 
160 158
                 // do pretty much the same for the require pattern -
161 159
                 //  but add the message if the pattern wasn't matched
162 160
                 !isset($config['name']['required_patterns']) ? [] : array_keys(array_filter(
163 161
                     array_flip($config['name']['required_patterns']),
164
-                    function ($pattern) use ($push) { return !preg_match($pattern, $push['context']['ref_name']); }
162
+                    function($pattern) use ($push) { return !preg_match($pattern, $push['context']['ref_name']); }
165 163
                 ))
166 164
             )
167 165
         ));
@@ -187,7 +185,7 @@  discard block
 block discarded – undo
187 185
             "\n\n",
188 186
             !array_key_exists('after_push_messages', $config) ? [] : array_keys(array_filter(
189 187
                 array_flip($config['after_push_messages']),
190
-                function ($action) use ($push) {
188
+                function($action) use ($push) {
191 189
                     // ensure we are displaying only the right messages for the context.
192 190
                     return isset($push['context']['is'][$action]) && $push['context']['is'][$action];
193 191
                 }
Please login to merge, or discard this patch.