Passed
Pull Request — master (#2)
by MediaCT
05:24
created
src/DataContainer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         return array_reduce(
51 51
             $this->parsePath($path),
52
-            function ($data, $key) use ($default) {
52
+            function($data, $key) use ($default) {
53 53
                 return is_array($data) && array_key_exists($key, $data)
54 54
                     ? $data[$key]
55 55
                     : $default;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $keys        = $this->parsePath($path);
82 82
         $last        = array_pop($keys);
83
-        $node        =& $this->getNodeReference($keys);
83
+        $node        = & $this->getNodeReference($keys);
84 84
         $node[$last] = $value;
85 85
     }
86 86
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         foreach ($this->glob($pattern) as $path) {
97 97
             $keys = $this->parsePath($path);
98 98
             $last = array_pop($keys);
99
-            $node =& $this->getNodeReference($keys);
99
+            $node = & $this->getNodeReference($keys);
100 100
             unset($node[$last]);
101 101
         }
102 102
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         return array_combine(
133 133
             $matches,
134 134
             array_map(
135
-                function ($match) use ($regex, $replacement) {
135
+                function($match) use ($regex, $replacement) {
136 136
                     return $this->replaceByRegex($regex, $match, $replacement);
137 137
                 },
138 138
                 $matches
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
     public function branch(string $pattern): array
151 151
     {
152 152
         return array_map(
153
-            function (array $data) : DataContainerInterface {
153
+            function(array $data) : DataContainerInterface {
154 154
                 return new static($data);
155 155
             },
156 156
             array_map(
157
-                function (string $path) : array {
157
+                function(string $path) : array {
158 158
                     return (array) $this->get($path, []);
159 159
                 },
160 160
                 $this->glob($pattern)
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     private function parsePath(string $path): array
227 227
     {
228 228
         return array_map(
229
-            function (string $key) {
229
+            function(string $key) {
230 230
                 return ctype_digit($key)
231 231
                     ? intval($key)
232 232
                     : $key;
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     private function &getNodeReference(array $keys): array
246 246
     {
247
-        $current =& $this->data;
247
+        $current = & $this->data;
248 248
 
249 249
         while (count($keys)) {
250 250
             $key = array_shift($keys);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                 $current[$key] = [];
255 255
             }
256 256
 
257
-            $current =& $current[$key];
257
+            $current = & $current[$key];
258 258
         }
259 259
 
260 260
         return $current;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $pattern      = array_shift($patterns);
278 278
         $matchingKeys = array_filter(
279 279
             array_keys($data),
280
-            function ($key) use ($pattern) {
280
+            function($key) use ($pattern) {
281 281
                 return fnmatch($pattern, $key);
282 282
             }
283 283
         );
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         if (preg_match($regex, $match, $matches)) {
324 324
             $replacement = preg_replace_callback(
325 325
                 '/\$([\d]+)/',
326
-                function (array $match) use ($matches) {
326
+                function(array $match) use ($matches) {
327 327
                     return array_key_exists($match[1], $matches)
328 328
                         ? $matches[$match[1]]
329 329
                         : $match[0];
Please login to merge, or discard this patch.