Passed
Push — main ( 4dbf6b...3fec3f )
by Breno
01:40
created
src/DotNotation.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) and is_array($temp[$key])) {
60
-            $temp =& $temp[$key];
60
+            $temp = & $temp[$key];
61 61
         }
62 62
     }
63 63
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     $target = $haystack;
82 82
     foreach ($keys as $innerKey) {
83
-        if (! is_array($target) || ! array_key_exists($innerKey, $target)) {
83
+        if (!is_array($target) || !array_key_exists($innerKey, $target)) {
84 84
             return false;
85 85
         }
86 86
 
Please login to merge, or discard this patch.