@@ -32,7 +32,7 @@ |
||
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 ( |
@@ -50,7 +50,7 @@ |
||
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]; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | return array_reduce( |
61 | 61 | $this->parsePath($path), |
62 | - function ($data, $key) use ($default) { |
|
62 | + function($data, $key) use ($default) { |
|
63 | 63 | return is_array($data) && array_key_exists($key, $data) |
64 | 64 | ? $data[$key] |
65 | 65 | : $default; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $keys = $this->parsePath($path); |
92 | 92 | $last = array_pop($keys); |
93 | - $node =& $this->getNodeReference($keys); |
|
93 | + $node = & $this->getNodeReference($keys); |
|
94 | 94 | |
95 | 95 | if (strlen($last) > 0) { |
96 | 96 | $node[$last] = $value; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ($this->glob($pattern) as $path) { |
112 | 112 | $keys = $this->parsePath($path); |
113 | 113 | $last = array_pop($keys); |
114 | - $node =& $this->getNodeReference($keys); |
|
114 | + $node = & $this->getNodeReference($keys); |
|
115 | 115 | unset($node[$last]); |
116 | 116 | } |
117 | 117 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return array_combine( |
150 | 150 | $matches, |
151 | 151 | array_map( |
152 | - function ($match) use ($pattern, $replacement) { |
|
152 | + function($match) use ($pattern, $replacement) { |
|
153 | 153 | return $this->replaceByPattern( |
154 | 154 | $pattern, |
155 | 155 | $match, |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | public function branch(string $pattern): array |
173 | 173 | { |
174 | 174 | return array_map( |
175 | - function (array $data): DataContainerInterface { |
|
175 | + function(array $data): DataContainerInterface { |
|
176 | 176 | return new static($data); |
177 | 177 | }, |
178 | 178 | array_map( |
179 | - function (string $path): array { |
|
179 | + function(string $path): array { |
|
180 | 180 | return (array) $this->get($path, []); |
181 | 181 | }, |
182 | 182 | $this->glob($pattern) |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | private function &getNodeReference(array $keys): array |
249 | 249 | { |
250 | - $current =& $this->data; |
|
250 | + $current = & $this->data; |
|
251 | 251 | |
252 | 252 | while (!empty($keys)) { |
253 | 253 | $key = array_shift($keys); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $current[$key] = []; |
259 | 259 | } |
260 | 260 | |
261 | - $current =& $current[$key]; |
|
261 | + $current = & $current[$key]; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | return $current; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $pattern = array_shift($patterns); |
282 | 282 | $matchingKeys = array_filter( |
283 | 283 | array_keys($data), |
284 | - function ($key) use ($pattern) { |
|
284 | + function($key) use ($pattern) { |
|
285 | 285 | return fnmatch($pattern, $key, FNM_NOESCAPE); |
286 | 286 | } |
287 | 287 | ); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | private function parsePath(string $path): array |
20 | 20 | { |
21 | 21 | return array_map( |
22 | - function (string $key) { |
|
22 | + function(string $key) { |
|
23 | 23 | return ctype_digit($key) && (strlen($key) === 1 || substr($key, 0, 1) !== "0") |
24 | 24 | ? intval($key) |
25 | 25 | : $key; |