Passed
Pull Request — master (#9)
by Ashoka
07:03
created
src/DataContainerFilterChain.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         return array_reduce(
34 34
             $this->filters,
35
-            function (
35
+            function(
36 36
                 bool $carry,
37 37
                 DataContainerFilterInterface $filter
38 38
             ) use (
Please login to merge, or discard this patch.
src/ReplaceByPatternTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         if (preg_match($regex, $match, $matches)) {
51 51
             $replacement = preg_replace_callback(
52 52
                 '/\$([\d]+)/',
53
-                function (array $match) use ($matches) {
53
+                function(array $match) use ($matches) {
54 54
                     return array_key_exists($match[1], $matches)
55 55
                         ? $matches[$match[1]]
56 56
                         : $match[0];
Please login to merge, or discard this patch.
src/DataContainer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         return array_reduce(
56 56
             $this->parsePath($path),
57
-            function ($data, $key) use ($default) {
57
+            function($data, $key) use ($default) {
58 58
                 return is_array($data) && array_key_exists($key, $data)
59 59
                     ? $data[$key]
60 60
                     : $default;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $keys = $this->parsePath($path);
87 87
         $last = array_pop($keys);
88
-        $node =& $this->getNodeReference($keys);
88
+        $node = & $this->getNodeReference($keys);
89 89
 
90 90
         if (strlen($last) > 0) {
91 91
             $node[$last] = $value;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         foreach ($this->glob($pattern) as $path) {
107 107
             $keys = $this->parsePath($path);
108 108
             $last = array_pop($keys);
109
-            $node =& $this->getNodeReference($keys);
109
+            $node = & $this->getNodeReference($keys);
110 110
             unset($node[$last]);
111 111
         }
112 112
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         return array_combine(
145 145
             $matches,
146 146
             array_map(
147
-                function ($match) use ($pattern, $replacement) {
147
+                function($match) use ($pattern, $replacement) {
148 148
                     return $this->replaceByPattern(
149 149
                         $pattern,
150 150
                         $match,
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
     public function branch(string $pattern): array
168 168
     {
169 169
         return array_map(
170
-            function (array $data) : DataContainerInterface {
170
+            function(array $data) : DataContainerInterface {
171 171
                 return new static($data);
172 172
             },
173 173
             array_map(
174
-                function (string $path) : array {
174
+                function(string $path) : array {
175 175
                     return (array) $this->get($path, []);
176 176
                 },
177 177
                 $this->glob($pattern)
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     private function parsePath(string $path): array
244 244
     {
245 245
         return array_map(
246
-            function (string $key) {
246
+            function(string $key) {
247 247
                 return ctype_digit($key)
248 248
                     ? intval($key)
249 249
                     : $key;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     private function &getNodeReference(array $keys): array
263 263
     {
264
-        $current =& $this->data;
264
+        $current = & $this->data;
265 265
 
266 266
         while (count($keys)) {
267 267
             $key = array_shift($keys);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                 $current[$key] = [];
272 272
             }
273 273
 
274
-            $current =& $current[$key];
274
+            $current = & $current[$key];
275 275
         }
276 276
 
277 277
         return $current;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         $pattern      = array_shift($patterns);
295 295
         $matchingKeys = array_filter(
296 296
             array_keys($data),
297
-            function ($key) use ($pattern) {
297
+            function($key) use ($pattern) {
298 298
                 return fnmatch($pattern, $key, FNM_NOESCAPE);
299 299
             }
300 300
         );
Please login to merge, or discard this patch.