Updated Rector to commit 3122ef482389945d97c26bb3ff5c2b0b3faf867b

3122ef4823 [NodeCollector] Fix non-string value on ArrayCallableMethodMatcher::resolveClassContextType() (#5780)
This commit is contained in:
Tomas Votruba 2024-03-28 09:11:42 +00:00
parent 30adaf3fc0
commit 7af3ed15e0
2 changed files with 7 additions and 10 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'eb525ca9fe04a8bc074cf49b5cf25991014fff5f';
public const PACKAGE_VERSION = '3122ef482389945d97c26bb3ff5c2b0b3faf867b';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-03-28 15:12:20';
public const RELEASE_DATE = '2024-03-28 09:09:29';
/**
* @var int
*/

View File

@ -142,6 +142,10 @@ final class ArrayCallableMethodMatcher
private function resolveClassContextType($classContext, Scope $scope, ?string $classMethodName)
{
$classConstantReference = $this->valueResolver->getValue($classContext);
// non-class value
if (!\is_string($classConstantReference)) {
return new MixedType();
}
if ($this->isRequiredClassReflectionResolution($classConstantReference)) {
$classReflection = $this->reflectionResolver->resolveClassReflection($classContext);
if (!$classReflection instanceof ClassReflection || !$classReflection->isClass()) {
@ -149,10 +153,6 @@ final class ArrayCallableMethodMatcher
}
$classConstantReference = $classReflection->getName();
}
// non-class value
if (!\is_string($classConstantReference)) {
return new MixedType();
}
if (!$this->reflectionProvider->hasClass($classConstantReference)) {
return new MixedType();
}
@ -191,9 +191,6 @@ final class ArrayCallableMethodMatcher
if ($classConstantReference === ObjectReference::STATIC) {
return \true;
}
if ($classConstantReference === '__CLASS__') {
return \true;
}
return \false;
return $classConstantReference === '__CLASS__';
}
}