@@ -133,6 +133,19 @@ static function (string $className): bool {
133133 return false ;
134134 }
135135
136+ // https://github.com/JetBrains/phpstorm-stubs/pull/1781
137+ /** @var list<class-string> $missingClasses */
138+ $ missingClasses = [
139+ 'NoDiscard ' ,
140+ 'DelayedTargetValidation ' ,
141+ ];
142+ if (
143+ PHP_VERSION_ID >= 80500
144+ && in_array ($ className , $ missingClasses , true )
145+ ) {
146+ return false ;
147+ }
148+
136149 // Check only always enabled extensions
137150 return in_array ($ reflection ->getExtensionName (), self ::EXTENSIONS , true );
138151 },
@@ -188,8 +201,17 @@ private function assertSameClassAttributes(CoreReflectionClass $original, Reflec
188201 $ this ->assertSameInterfaces ($ original , $ stubbed );
189202
190203 foreach ($ original ->getMethods () as $ method ) {
204+ $ methodName = $ original ->getName () . '# ' . $ method ->getName ();
205+
206+ // https://github.com/JetBrains/phpstorm-stubs/pull/1781
207+ if (
208+ in_array ($ methodName , ['Closure#getCurrent ' ], true )
209+ ) {
210+ continue ;
211+ }
212+
191213 $ stubbedMethod = $ stubbed ->getMethod ($ method ->getName ());
192- self ::assertNotNull ($ stubbedMethod );
214+ self ::assertNotNull ($ stubbedMethod, $ methodName );
193215
194216 $ this ->assertSameMethodAttributes ($ method , $ stubbedMethod );
195217 }
@@ -204,10 +226,19 @@ private function assertSameClassAttributes(CoreReflectionClass $original, Reflec
204226 $ originalConstantName = $ originalConstant ->getName ();
205227 assert ($ originalConstantName !== '' );
206228
229+ $ constantName = $ original ->getName () . ':: ' . $ originalConstant ->getName ();
230+
231+ // https://github.com/JetBrains/phpstorm-stubs/pull/1781
232+ if (
233+ in_array ($ constantName , ['Attribute::TARGET_CONSTANT ' ], true )
234+ ) {
235+ continue ;
236+ }
237+
207238 $ stubbedConstant = $ stubbed ->getConstant ($ originalConstantName );
208239
209- self ::assertNotNull ($ stubbedConstant );
210- self ::assertSame ($ originalConstant ->getValue (), $ stubbedConstant ->getValue ());
240+ self ::assertNotNull ($ stubbedConstant, $ constantName );
241+ self ::assertSame ($ originalConstant ->getValue (), $ stubbedConstant ->getValue (), $ constantName );
211242 }
212243 }
213244
@@ -301,6 +332,20 @@ public static function internalFunctionsProvider(): array
301332 static function (string $ functionName ): bool {
302333 $ reflection = new CoreReflectionFunction ($ functionName );
303334
335+ // https://github.com/JetBrains/phpstorm-stubs/pull/1781
336+ if (
337+ PHP_VERSION_ID >= 80500
338+ && in_array ($ functionName , [
339+ 'array_first ' ,
340+ 'array_last ' ,
341+ 'clone ' ,
342+ 'get_error_handler ' ,
343+ 'get_exception_handler ' ,
344+ ], true )
345+ ) {
346+ return false ;
347+ }
348+
304349 // Check only always enabled extensions
305350 return in_array ($ reflection ->getExtensionName (), self ::EXTENSIONS , true );
306351 },
@@ -361,6 +406,18 @@ public static function internalConstantsProvider(): array
361406 }
362407
363408 foreach ($ extensionConstants as $ constantName => $ constantValue ) {
409+ // https://github.com/JetBrains/phpstorm-stubs/pull/1781
410+ if (
411+ PHP_VERSION_ID >= 80500
412+ && in_array ($ constantName , [
413+ 'IMAGETYPE_SVG ' ,
414+ 'IMAGETYPE_HEIF ' ,
415+ 'PHP_BUILD_DATE ' ,
416+ ], true )
417+ ) {
418+ continue ;
419+ }
420+
364421 $ provider [] = [$ constantName , $ constantValue , $ extensionName ];
365422 }
366423 }
0 commit comments