Skip to content

Commit cda22a9

Browse files
Merge pull request #36 from martin-helmich/bugfix/fix-deprecation
Fix deprecation warnings
2 parents d24f266 + d38361a commit cda22a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MockCollection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,19 @@ private function updateCore(&$doc, $update)
216216
}
217217

218218
foreach ($update['$unset'] ?? [] as $k => $v) {
219-
if (array_key_exists($k, $doc)) {
219+
if (isset($doc[$k])) {
220220
unset($doc[$k]);
221221
}
222222
}
223223

224224
foreach ($update['$inc'] ?? [] as $k => $v) {
225-
if (array_key_exists($k, $doc) && is_integer($v) && is_integer($doc[$k])) {
225+
if (isset($doc[$k]) && is_integer($v) && is_integer($doc[$k])) {
226226
$doc[$k] += $v;
227227
}
228228
}
229229

230230
foreach ($update['$push'] ?? [] as $k => $v) {
231-
if (array_key_exists($k, $doc) && is_array($doc[$k])) {
231+
if (isset($doc[$k]) && is_array($doc[$k])) {
232232
$doc[$k][] = $v;
233233
}
234234
}

0 commit comments

Comments
 (0)