Skip to content

Commit 09379ce

Browse files
authored
Merge pull request #81 from mpesari/main
Fix deprecation warning on PHP 8.5
2 parents eee0a11 + 18cbc1c commit 09379ce

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

.github/workflows/Test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- '8.2'
2424
- '8.3'
2525
- '8.4'
26+
- '8.5'
2627
continue-on-error: ${{ matrix.php == '8.4' }}
2728
name: PHP ${{ matrix.php }} Test
2829

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"source": "https://github.com/SoftCreatR/JSONPath"
2525
},
2626
"require": {
27-
"php": "8.1 - 8.4",
27+
"php": "8.1 - 8.5",
2828
"ext-json": "*"
2929
},
3030
"require-dev": {

src/AccessHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function keyExists(mixed $collection, $key, bool $magicIsAllowed =
3737
}
3838

3939
if (\is_array($collection)) {
40-
return \array_key_exists($key, $collection);
40+
return \array_key_exists($key ?? '', $collection);
4141
}
4242

4343
if ($collection instanceof ArrayAccess) {

tests/QueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function testQueries(
102102
);
103103
}
104104
}
105-
} catch (JSONPathException | RuntimeException $e) {
105+
} catch (JSONPathException|RuntimeException $e) {
106106
if (!\in_array($id, self::$baselineFailedQueries, true)) {
107107
throw new RuntimeException(
108108
$e->getMessage() . "\nQuery: {$query}\n\nMore information: {$url}",

0 commit comments

Comments
 (0)