@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | function set_path(array &$haystack, string $path, $value, string $separator = '.'): void |
| 14 | 14 | { |
| 15 | 15 | $path = explode($separator, $path); |
| 16 | - $temp =& $haystack; |
|
| 16 | + $temp = & $haystack; |
|
| 17 | 17 | |
| 18 | 18 | foreach ($path as $key) { |
| 19 | 19 | if (!is_array($temp)) { |
| 20 | 20 | $temp = []; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $temp =& $temp[$key]; |
|
| 23 | + $temp = & $temp[$key]; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $temp = $value; |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | return |
| 39 | 39 | array_reduce( |
| 40 | 40 | explode($separator, $path), |
| 41 | - fn ($arr, $key) => |
|
| 42 | - $default!== $arr && is_array($arr) && array_key_exists($key, $arr) ? $arr[$key] : $default, |
|
| 41 | + fn($arr, $key) => |
|
| 42 | + $default !== $arr && is_array($arr) && array_key_exists($key, $arr) ? $arr[$key] : $default, |
|
| 43 | 43 | $haystack |
| 44 | 44 | ); |
| 45 | 45 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $target = &$haystack; |
| 62 | 62 | foreach ($keys as $innerKey) { |
| 63 | - if (! is_array($target)) { |
|
| 63 | + if (!is_array($target)) { |
|
| 64 | 64 | break; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $target = $haystack; |
| 90 | 90 | foreach ($keys as $innerKey) { |
| 91 | - if (! is_array($target) || ! array_key_exists($innerKey, $target)) { |
|
| 91 | + if (!is_array($target) || !array_key_exists($innerKey, $target)) { |
|
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | |