@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $added = 0; |
| 18 | 18 | foreach ($elements as $element) { |
| 19 | - if (! in_array($element, $set, true)) { |
|
| 19 | + if (!in_array($element, $set, true)) { |
|
| 20 | 20 | $set[] = $element; |
| 21 | 21 | $added++; |
| 22 | 22 | } |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | $keys[] = $iterator->getSubIterator($depth)->key(); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if (! empty($pathSeparator)) { |
|
| 25 | - $result[join($pathSeparator, $keys) ] = $leafValue; |
|
| 24 | + if (!empty($pathSeparator)) { |
|
| 25 | + $result[join($pathSeparator, $keys)] = $leafValue; |
|
| 26 | 26 | } else { |
| 27 | 27 | $result[] = $leafValue; |
| 28 | 28 | } |
@@ -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 | } |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | function unset_path(array &$haystack, string $path, string $separator = '.') |
| 54 | 54 | { |
| 55 | 55 | $keys = explode($separator, $path); |
| 56 | - $temp =& $haystack; |
|
| 56 | + $temp = & $haystack; |
|
| 57 | 57 | while (count($keys) > 1) { |
| 58 | 58 | $key = array_shift($keys); |
| 59 | 59 | if (array_key_exists($key, $temp) && is_array($temp[$key])) { |
| 60 | - $temp =& $temp[$key]; |
|
| 60 | + $temp = & $temp[$key]; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $keys = explode($separator, $path); |
| 76 | 76 | $temp = $haystack; |
| 77 | 77 | foreach ($keys as $key) { |
| 78 | - if (! is_array($temp) || ! array_key_exists($key, $temp)) { |
|
| 78 | + if (!is_array($temp) || !array_key_exists($key, $temp)) { |
|
| 79 | 79 | return false; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | function none(iterable $items, callable $callback, int $mode = 0): bool |
| 12 | 12 | { |
| 13 | - return ! some($items, $callback, $mode); |
|
| 13 | + return !some($items, $callback, $mode); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function first(iterable $items, callable $callback, $default = null, int $mode = CALLBACK_USE_VALUE) |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | function has(array $items, ...$keys): bool |
| 71 | 71 | { |
| 72 | - return ! array_diff($keys, array_keys($items)); |
|
| 72 | + return !array_diff($keys, array_keys($items)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | function only(array $items, ...$keys): array |