Skip to content

Commit ee24e7f

Browse files
committed
Run tests and static analysis on PHP 8.5
1 parent a0a3ffe commit ee24e7f

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- "8.2"
2626
- "8.3"
2727
- "8.4"
28+
- "8.5"
2829
operating-system:
2930
- "ubuntu-latest"
3031
- "windows-latest"
@@ -69,6 +70,7 @@ jobs:
6970
- "8.2"
7071
- "8.3"
7172
- "8.4"
73+
- "8.5"
7274
operating-system:
7375
- "ubuntu-latest"
7476

@@ -110,6 +112,7 @@ jobs:
110112
- "locked"
111113
php-version:
112114
- "8.4"
115+
- "8.5"
113116
operating-system:
114117
- "ubuntu-latest"
115118

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Better Reflection - an improved code reflection API",
44
"license": "MIT",
55
"require": {
6-
"php": "~8.2.0 || ~8.3.2 || ~8.4.1",
6+
"php": "~8.2.0 || ~8.3.2 || ~8.4.1 || ~8.5.0",
77
"ext-json": "*",
88
"jetbrains/phpstorm-stubs": "2024.3",
99
"nikic/php-parser": "^5.6.0"

test/unit/SourceLocator/SourceStubber/PhpStormStubsSourceStubberTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ static function (string $className): bool {
133133
return false;
134134
}
135135

136+
// Missing in JetBrains/phpstorm-stubs
137+
/** @phpstan-ignore greaterOrEqual.alwaysFalse, booleanAnd.alwaysFalse */
138+
if (
139+
PHP_VERSION_ID >= 80500
140+
&& in_array($className, ['NoDiscard'], true)
141+
) {
142+
return false;
143+
}
144+
136145
// Check only always enabled extensions
137146
return in_array($reflection->getExtensionName(), self::EXTENSIONS, true);
138147
},
@@ -301,6 +310,21 @@ public static function internalFunctionsProvider(): array
301310
static function (string $functionName): bool {
302311
$reflection = new CoreReflectionFunction($functionName);
303312

313+
// Missing in JetBrains/phpstorm-stubs
314+
/** @phpstan-ignore greaterOrEqual.alwaysFalse, booleanAnd.alwaysFalse */
315+
if (
316+
PHP_VERSION_ID >= 80500
317+
&& in_array($functionName, [
318+
'array_first',
319+
'array_last',
320+
'clone',
321+
'get_error_handler',
322+
'get_exception_handler',
323+
], true)
324+
) {
325+
return false;
326+
}
327+
304328
// Check only always enabled extensions
305329
return in_array($reflection->getExtensionName(), self::EXTENSIONS, true);
306330
},
@@ -361,6 +385,19 @@ public static function internalConstantsProvider(): array
361385
}
362386

363387
foreach ($extensionConstants as $constantName => $constantValue) {
388+
// Missing in JetBrains/phpstorm-stubs
389+
/** @phpstan-ignore greaterOrEqual.alwaysFalse, booleanAnd.alwaysFalse */
390+
if (
391+
PHP_VERSION_ID >= 80500
392+
&& in_array($constantName, [
393+
'IMAGETYPE_SVG',
394+
'IMAGETYPE_HEIF',
395+
'PHP_BUILD_DATE',
396+
], true)
397+
) {
398+
continue;
399+
}
400+
364401
$provider[] = [$constantName, $constantValue, $extensionName];
365402
}
366403
}

0 commit comments

Comments
 (0)