@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | return array_reduce( |
| 53 | 53 | $this->parsePath($path), |
| 54 | - function ($data, $key) use ($default) { |
|
| 54 | + function($data, $key) use ($default) { |
|
| 55 | 55 | return is_array($data) && array_key_exists($key, $data) |
| 56 | 56 | ? $data[$key] |
| 57 | 57 | : $default; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $keys = $this->parsePath($path); |
| 84 | 84 | $last = array_pop($keys); |
| 85 | - $node =& $this->getNodeReference($keys); |
|
| 85 | + $node = & $this->getNodeReference($keys); |
|
| 86 | 86 | $node[$last] = $value; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | foreach ($this->glob($pattern) as $path) { |
| 99 | 99 | $keys = $this->parsePath($path); |
| 100 | 100 | $last = array_pop($keys); |
| 101 | - $node =& $this->getNodeReference($keys); |
|
| 101 | + $node = & $this->getNodeReference($keys); |
|
| 102 | 102 | unset($node[$last]); |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | return array_combine( |
| 135 | 135 | $matches, |
| 136 | 136 | array_map( |
| 137 | - function ($match) use ($pattern, $replacement) { |
|
| 137 | + function($match) use ($pattern, $replacement) { |
|
| 138 | 138 | return $this->replaceByPattern( |
| 139 | 139 | $pattern, |
| 140 | 140 | $match, |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | public function branch(string $pattern): array |
| 158 | 158 | { |
| 159 | 159 | return array_map( |
| 160 | - function (array $data) : DataContainerInterface { |
|
| 160 | + function(array $data) : DataContainerInterface { |
|
| 161 | 161 | return new static($data); |
| 162 | 162 | }, |
| 163 | 163 | array_map( |
| 164 | - function (string $path) : array { |
|
| 164 | + function(string $path) : array { |
|
| 165 | 165 | return (array) $this->get($path, []); |
| 166 | 166 | }, |
| 167 | 167 | $this->glob($pattern) |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | private function parsePath(string $path): array |
| 234 | 234 | { |
| 235 | 235 | return array_map( |
| 236 | - function (string $key) { |
|
| 236 | + function(string $key) { |
|
| 237 | 237 | return ctype_digit($key) |
| 238 | 238 | ? intval($key) |
| 239 | 239 | : $key; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | private function &getNodeReference(array $keys): array |
| 253 | 253 | { |
| 254 | - $current =& $this->data; |
|
| 254 | + $current = & $this->data; |
|
| 255 | 255 | |
| 256 | 256 | while (count($keys)) { |
| 257 | 257 | $key = array_shift($keys); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $current[$key] = []; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - $current =& $current[$key]; |
|
| 264 | + $current = & $current[$key]; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | return $current; |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | $pattern = array_shift($patterns); |
| 285 | 285 | $matchingKeys = array_filter( |
| 286 | 286 | array_keys($data), |
| 287 | - function ($key) use ($pattern) { |
|
| 287 | + function($key) use ($pattern) { |
|
| 288 | 288 | return fnmatch($pattern, $key, FNM_NOESCAPE); |
| 289 | 289 | } |
| 290 | 290 | ); |
@@ -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]; |