diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 95a8a85..0abee78 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -23,6 +23,7 @@ jobs: - '8.2' - '8.3' - '8.4' + - '8.5' continue-on-error: ${{ matrix.php == '8.4' }} name: PHP ${{ matrix.php }} Test diff --git a/composer.json b/composer.json index 9d8ffa7..232a327 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "source": "https://github.com/SoftCreatR/JSONPath" }, "require": { - "php": "8.1 - 8.4", + "php": "8.1 - 8.5", "ext-json": "*" }, "require-dev": { diff --git a/src/AccessHelper.php b/src/AccessHelper.php index c8b0140..1d7e363 100644 --- a/src/AccessHelper.php +++ b/src/AccessHelper.php @@ -37,7 +37,7 @@ public static function keyExists(mixed $collection, $key, bool $magicIsAllowed = } if (\is_array($collection)) { - return \array_key_exists($key, $collection); + return \array_key_exists($key ?? '', $collection); } if ($collection instanceof ArrayAccess) { diff --git a/tests/QueryTest.php b/tests/QueryTest.php index db296cd..e832c41 100644 --- a/tests/QueryTest.php +++ b/tests/QueryTest.php @@ -102,7 +102,7 @@ public function testQueries( ); } } - } catch (JSONPathException | RuntimeException $e) { + } catch (JSONPathException|RuntimeException $e) { if (!\in_array($id, self::$baselineFailedQueries, true)) { throw new RuntimeException( $e->getMessage() . "\nQuery: {$query}\n\nMore information: {$url}",