@@ -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]; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | return array_reduce( |
59 | 59 | $this->parsePath($path), |
60 | - function ($data, $key) use ($default) { |
|
60 | + function($data, $key) use ($default) { |
|
61 | 61 | return is_array($data) && array_key_exists($key, $data) |
62 | 62 | ? $data[$key] |
63 | 63 | : $default; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
89 | 89 | $keys = $this->parsePath($path); |
90 | 90 | $last = array_pop($keys); |
91 | - $node =& $this->getNodeReference($keys); |
|
91 | + $node = & $this->getNodeReference($keys); |
|
92 | 92 | |
93 | 93 | if (strlen($last) > 0) { |
94 | 94 | $node[$last] = $value; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach ($this->glob($pattern) as $path) { |
110 | 110 | $keys = $this->parsePath($path); |
111 | 111 | $last = array_pop($keys); |
112 | - $node =& $this->getNodeReference($keys); |
|
112 | + $node = & $this->getNodeReference($keys); |
|
113 | 113 | unset($node[$last]); |
114 | 114 | } |
115 | 115 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | : $this->findArrayPathsByPatterns( |
129 | 129 | $this->data, |
130 | 130 | array_map( |
131 | - function (string $part): string { |
|
131 | + function(string $part): string { |
|
132 | 132 | return trim($part, static::ENCLOSURE); |
133 | 133 | }, |
134 | 134 | str_getcsv($pattern, static::SEPARATOR, static::ENCLOSURE, static::ESCAPE) |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | return array_combine( |
153 | 153 | $matches, |
154 | 154 | array_map( |
155 | - function ($match) use ($pattern, $replacement) { |
|
155 | + function($match) use ($pattern, $replacement) { |
|
156 | 156 | return $this->replaceByPattern( |
157 | 157 | $pattern, |
158 | 158 | $match, |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | public function branch(string $pattern): array |
176 | 176 | { |
177 | 177 | return array_map( |
178 | - function (array $data): DataContainerInterface { |
|
178 | + function(array $data): DataContainerInterface { |
|
179 | 179 | return new static($data); |
180 | 180 | }, |
181 | 181 | array_map( |
182 | - function (string $path): array { |
|
182 | + function(string $path): array { |
|
183 | 183 | return (array) $this->get($path, []); |
184 | 184 | }, |
185 | 185 | $this->glob($pattern) |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | private function parsePath(string $path): array |
252 | 252 | { |
253 | 253 | return array_map( |
254 | - function (string $key) { |
|
254 | + function(string $key) { |
|
255 | 255 | return ctype_digit($key) |
256 | 256 | ? intval($key) |
257 | 257 | : $key; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | private function &getNodeReference(array $keys): array |
274 | 274 | { |
275 | - $current =& $this->data; |
|
275 | + $current = & $this->data; |
|
276 | 276 | |
277 | 277 | while (!empty($keys)) { |
278 | 278 | $key = array_shift($keys); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $current[$key] = []; |
284 | 284 | } |
285 | 285 | |
286 | - $current =& $current[$key]; |
|
286 | + $current = & $current[$key]; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | return $current; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $pattern = array_shift($patterns); |
307 | 307 | $matchingKeys = array_filter( |
308 | 308 | array_keys($data), |
309 | - function ($key) use ($pattern) { |
|
309 | + function($key) use ($pattern) { |
|
310 | 310 | return fnmatch($pattern, $key, FNM_NOESCAPE); |
311 | 311 | } |
312 | 312 | ); |