13
13
14
14
namespace Laudis \Neo4j \Types ;
15
15
16
+ use function array_key_exists ;
16
17
use function array_key_first ;
17
18
use function array_key_last ;
18
19
use function array_keys ;
@@ -106,7 +107,7 @@ public function getIterator()
106
107
*/
107
108
public function offsetExists ($ offset ): bool
108
109
{
109
- return isset ( $ this ->map [ $ offset ] );
110
+ return array_key_exists ( $ offset , $ this ->map );
110
111
}
111
112
112
113
/**
@@ -174,7 +175,7 @@ public function skip(int $position): ?Pair
174
175
{
175
176
$ keys = $ this ->keys ();
176
177
177
- if (isset ( $ keys [ $ position] )) {
178
+ if (array_key_exists ( $ position, $ keys )) {
178
179
$ key = $ keys [$ position ];
179
180
180
181
return new Pair ($ key , $ this ->map [$ key ]);
@@ -208,7 +209,7 @@ public function intersect(iterable $map): CypherMap
208
209
{
209
210
$ tbr = [];
210
211
foreach ($ map as $ key => $ value ) {
211
- if (isset ( $ this ->map [ $ key ] )) {
212
+ if (array_key_exists ( $ key , $ this ->map )) {
212
213
$ tbr [$ key ] = $ this ->map [$ key ];
213
214
}
214
215
}
@@ -226,7 +227,7 @@ public function diff($map): CypherMap
226
227
$ tbr = $ this ->map ;
227
228
/** @psalm-suppress UnusedForeachValue */
228
229
foreach ($ map as $ key => $ value ) {
229
- if (isset ( $ tbr [ $ key] )) {
230
+ if (array_key_exists ( $ key, $ tbr )) {
230
231
unset($ tbr [$ key ]);
231
232
}
232
233
}
@@ -236,7 +237,7 @@ public function diff($map): CypherMap
236
237
237
238
public function hasKey (string $ key ): bool
238
239
{
239
- return isset ( $ this ->map [ $ key ] );
240
+ return array_key_exists ( $ key , $ this ->map );
240
241
}
241
242
242
243
/**
@@ -285,7 +286,7 @@ public function get(string $key, $default = null)
285
286
return $ this ->map [$ key ] ?? $ default ;
286
287
}
287
288
288
- if (!isset ( $ this ->map [ $ key ] )) {
289
+ if (!array_key_exists ( $ key , $ this ->map )) {
289
290
throw new OutOfBoundsException ();
290
291
}
291
292
@@ -446,14 +447,14 @@ public function xor(iterable $map): CypherMap
446
447
{
447
448
$ tbr = [];
448
449
foreach ($ map as $ key => $ value ) {
449
- if (!isset ( $ this ->map [ $ key ] )) {
450
+ if (!array_key_exists ( $ key , $ this ->map )) {
450
451
$ tbr [$ key ] = $ value ;
451
452
}
452
453
}
453
454
454
455
$ cypherMap = new self ($ map );
455
456
foreach ($ this ->map as $ key => $ value ) {
456
- if (!isset ( $ cypherMap ->map [ $ key ] )) {
457
+ if (!array_key_exists ( $ key , $ cypherMap ->map )) {
457
458
$ tbr [$ key ] = $ value ;
458
459
}
459
460
}
0 commit comments