-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ef3c87
commit baf359e
Showing
5 changed files
with
42 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,6 @@ public function __construct( | |
private ReflectionProvider\ReflectionProviderProvider $reflectionProviderProvider, | ||
private FileTypeMapper $fileTypeMapper, | ||
private bool $inferPrivatePropertyTypeFromConstructor, | ||
Check failure on line 100 in src/Reflection/Php/PhpClassReflectionExtension.php GitHub Actions / PHPStan (7.4, ubuntu-latest)
Check failure on line 100 in src/Reflection/Php/PhpClassReflectionExtension.php GitHub Actions / PHPStan (7.4, windows-latest)
|
||
private array $universalObjectCratesClasses, | ||
) | ||
{ | ||
} | ||
|
@@ -398,20 +397,7 @@ public function getMethod(ClassReflection $classReflection, string $methodName): | |
|
||
public function hasNativeMethod(ClassReflection $classReflection, string $methodName): bool | ||
{ | ||
$hasMethod = $this->hasMethod($classReflection, $methodName); | ||
if ($hasMethod) { | ||
return true; | ||
} | ||
|
||
if ($methodName === '__get' && UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( | ||
$this->reflectionProviderProvider->getReflectionProvider(), | ||
$this->universalObjectCratesClasses, | ||
$classReflection, | ||
)) { | ||
return true; | ||
} | ||
|
||
return false; | ||
return $this->hasMethod($classReflection, $methodName); | ||
} | ||
|
||
public function getNativeMethod(ClassReflection $classReflection, string $methodName): ExtendedMethodReflection | ||
|
@@ -420,27 +406,14 @@ public function getNativeMethod(ClassReflection $classReflection, string $method | |
return $this->nativeMethods[$classReflection->getCacheKey()][$methodName]; | ||
} | ||
|
||
if ($classReflection->getNativeReflection()->hasMethod($methodName)) { | ||
$nativeMethodReflection = new NativeBuiltinMethodReflection( | ||
$classReflection->getNativeReflection()->getMethod($methodName), | ||
); | ||
} else { | ||
if ( | ||
$methodName !== '__get' | ||
|| !UniversalObjectCratesClassReflectionExtension::isUniversalObjectCrate( | ||
$this->reflectionProviderProvider->getReflectionProvider(), | ||
$this->universalObjectCratesClasses, | ||
$classReflection, | ||
)) { | ||
throw new ShouldNotHappenException(); | ||
} | ||
|
||
$nativeMethodReflection = new FakeBuiltinMethodReflection( | ||
$methodName, | ||
$classReflection->getNativeReflection(), | ||
); | ||
if (!$classReflection->getNativeReflection()->hasMethod($methodName)) { | ||
throw new ShouldNotHappenException(); | ||
} | ||
|
||
$nativeMethodReflection = new NativeBuiltinMethodReflection( | ||
$classReflection->getNativeReflection()->getMethod($methodName), | ||
); | ||
|
||
if (!isset($this->nativeMethods[$classReflection->getCacheKey()][$nativeMethodReflection->getName()])) { | ||
$method = $this->createMethod($classReflection, $nativeMethodReflection, false); | ||
$this->nativeMethods[$classReflection->getCacheKey()][$nativeMethodReflection->getName()] = $method; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Bug10149; | ||
|
||
trait WarnDynamicPropertyTrait | ||
{ | ||
/** | ||
* @return mixed | ||
*/ | ||
#[\Override] | ||
public function &__get(string $name) | ||
{ | ||
return $this->{$name}; | ||
} | ||
} | ||
|
||
class StdSat extends \stdClass | ||
{ | ||
use WarnDynamicPropertyTrait; | ||
} |