@@ -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