@@ -98,7 +98,6 @@ public function __construct(
98
98
private ReflectionProvider \ReflectionProviderProvider $ reflectionProviderProvider ,
99
99
private FileTypeMapper $ fileTypeMapper ,
100
100
private bool $ inferPrivatePropertyTypeFromConstructor ,
101
- private array $ universalObjectCratesClasses ,
102
101
)
103
102
{
104
103
}
@@ -398,20 +397,7 @@ public function getMethod(ClassReflection $classReflection, string $methodName):
398
397
399
398
public function hasNativeMethod (ClassReflection $ classReflection , string $ methodName ): bool
400
399
{
401
- $ hasMethod = $ this ->hasMethod ($ classReflection , $ methodName );
402
- if ($ hasMethod ) {
403
- return true ;
404
- }
405
-
406
- if ($ methodName === '__get ' && UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate (
407
- $ this ->reflectionProviderProvider ->getReflectionProvider (),
408
- $ this ->universalObjectCratesClasses ,
409
- $ classReflection ,
410
- )) {
411
- return true ;
412
- }
413
-
414
- return false ;
400
+ return $ this ->hasMethod ($ classReflection , $ methodName );
415
401
}
416
402
417
403
public function getNativeMethod (ClassReflection $ classReflection , string $ methodName ): ExtendedMethodReflection
@@ -420,27 +406,14 @@ public function getNativeMethod(ClassReflection $classReflection, string $method
420
406
return $ this ->nativeMethods [$ classReflection ->getCacheKey ()][$ methodName ];
421
407
}
422
408
423
- if ($ classReflection ->getNativeReflection ()->hasMethod ($ methodName )) {
424
- $ nativeMethodReflection = new NativeBuiltinMethodReflection (
425
- $ classReflection ->getNativeReflection ()->getMethod ($ methodName ),
426
- );
427
- } else {
428
- if (
429
- $ methodName !== '__get '
430
- || !UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate (
431
- $ this ->reflectionProviderProvider ->getReflectionProvider (),
432
- $ this ->universalObjectCratesClasses ,
433
- $ classReflection ,
434
- )) {
435
- throw new ShouldNotHappenException ();
436
- }
437
-
438
- $ nativeMethodReflection = new FakeBuiltinMethodReflection (
439
- $ methodName ,
440
- $ classReflection ->getNativeReflection (),
441
- );
409
+ if (!$ classReflection ->getNativeReflection ()->hasMethod ($ methodName )) {
410
+ throw new ShouldNotHappenException ();
442
411
}
443
412
413
+ $ nativeMethodReflection = new NativeBuiltinMethodReflection (
414
+ $ classReflection ->getNativeReflection ()->getMethod ($ methodName ),
415
+ );
416
+
444
417
if (!isset ($ this ->nativeMethods [$ classReflection ->getCacheKey ()][$ nativeMethodReflection ->getName ()])) {
445
418
$ method = $ this ->createMethod ($ classReflection , $ nativeMethodReflection , false );
446
419
$ this ->nativeMethods [$ classReflection ->getCacheKey ()][$ nativeMethodReflection ->getName ()] = $ method ;
0 commit comments