@@ -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) |
| 24 | 24 | ? intval($key) |
| 25 | 25 | : $key; |