1313
1414namespace Laudis \Neo4j \Types ;
1515
16+ use function array_key_exists ;
1617use function array_key_first ;
1718use function array_key_last ;
1819use function array_keys ;
@@ -106,7 +107,7 @@ public function getIterator()
106107 */
107108 public function offsetExists ($ offset ): bool
108109 {
109- return isset ( $ this ->map [ $ offset ] );
110+ return array_key_exists ( $ offset , $ this ->map );
110111 }
111112
112113 /**
@@ -174,7 +175,7 @@ public function skip(int $position): ?Pair
174175 {
175176 $ keys = $ this ->keys ();
176177
177- if (isset ( $ keys [ $ position] )) {
178+ if (array_key_exists ( $ position, $ keys )) {
178179 $ key = $ keys [$ position ];
179180
180181 return new Pair ($ key , $ this ->map [$ key ]);
@@ -208,7 +209,7 @@ public function intersect(iterable $map): CypherMap
208209 {
209210 $ tbr = [];
210211 foreach ($ map as $ key => $ value ) {
211- if (isset ( $ this ->map [ $ key ] )) {
212+ if (array_key_exists ( $ key , $ this ->map )) {
212213 $ tbr [$ key ] = $ this ->map [$ key ];
213214 }
214215 }
@@ -226,7 +227,7 @@ public function diff($map): CypherMap
226227 $ tbr = $ this ->map ;
227228 /** @psalm-suppress UnusedForeachValue */
228229 foreach ($ map as $ key => $ value ) {
229- if (isset ( $ tbr [ $ key] )) {
230+ if (array_key_exists ( $ key, $ tbr )) {
230231 unset($ tbr [$ key ]);
231232 }
232233 }
@@ -236,7 +237,7 @@ public function diff($map): CypherMap
236237
237238 public function hasKey (string $ key ): bool
238239 {
239- return isset ( $ this ->map [ $ key ] );
240+ return array_key_exists ( $ key , $ this ->map );
240241 }
241242
242243 /**
@@ -285,7 +286,7 @@ public function get(string $key, $default = null)
285286 return $ this ->map [$ key ] ?? $ default ;
286287 }
287288
288- if (!isset ( $ this ->map [ $ key ] )) {
289+ if (!array_key_exists ( $ key , $ this ->map )) {
289290 throw new OutOfBoundsException ();
290291 }
291292
@@ -446,14 +447,14 @@ public function xor(iterable $map): CypherMap
446447 {
447448 $ tbr = [];
448449 foreach ($ map as $ key => $ value ) {
449- if (!isset ( $ this ->map [ $ key ] )) {
450+ if (!array_key_exists ( $ key , $ this ->map )) {
450451 $ tbr [$ key ] = $ value ;
451452 }
452453 }
453454
454455 $ cypherMap = new self ($ map );
455456 foreach ($ this ->map as $ key => $ value ) {
456- if (!isset ( $ cypherMap ->map [ $ key ] )) {
457+ if (!array_key_exists ( $ key , $ cypherMap ->map )) {
457458 $ tbr [$ key ] = $ value ;
458459 }
459460 }
0 commit comments