Skip to content

Commit

Permalink
Prefer array_key_exists over isset
Browse files Browse the repository at this point in the history
  • Loading branch information
lhsazevedo committed Oct 31, 2024
1 parent 2444e23 commit 44052a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/PHP/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private function findParentBookOrSet(string $id): ?array

// isset() to guard against undefined array keys, either for root
// elements (no parent) or in case the index structure is broken.
while (isset($this->indexes[$id])) {
while (array_key_exists($id, $this->indexes)) {
$parent = $this->indexes[$id];
$element = $parent['element'];

Expand Down

0 comments on commit 44052a0

Please sign in to comment.