mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
Updated Rector to commit a8cc19a3c0387f082fd432e04afce363a90ba5b0
a8cc19a3c0
[NodeTypeResolver] Handle crash PHPStan\File\CouldNotReadFileException: Could not read file on IntermediateSourceLocator (#5438)
This commit is contained in:
parent
3c0a61462c
commit
22304be44f
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '9a794f4ac4a100c1bffbf6af5a0c15f9628f3b90';
|
||||
public const PACKAGE_VERSION = 'a8cc19a3c0387f082fd432e04afce363a90ba5b0';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-06 12:59:16';
|
||||
public const RELEASE_DATE = '2024-01-06 18:04:23';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -8,6 +8,7 @@ use PHPStan\BetterReflection\Identifier\IdentifierType;
|
|||
use PHPStan\BetterReflection\Reflection\Reflection;
|
||||
use PHPStan\BetterReflection\Reflector\Reflector;
|
||||
use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator;
|
||||
use PHPStan\File\CouldNotReadFileException;
|
||||
use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider;
|
||||
final class IntermediateSourceLocator implements SourceLocator
|
||||
{
|
||||
|
@ -23,7 +24,11 @@ final class IntermediateSourceLocator implements SourceLocator
|
|||
public function locateIdentifier(Reflector $reflector, Identifier $identifier) : ?Reflection
|
||||
{
|
||||
$sourceLocator = $this->dynamicSourceLocatorProvider->provide();
|
||||
$reflection = $sourceLocator->locateIdentifier($reflector, $identifier);
|
||||
try {
|
||||
$reflection = $sourceLocator->locateIdentifier($reflector, $identifier);
|
||||
} catch (CouldNotReadFileException $exception) {
|
||||
return null;
|
||||
}
|
||||
if ($reflection instanceof Reflection) {
|
||||
return $reflection;
|
||||
}
|
||||
|
@ -36,7 +41,11 @@ final class IntermediateSourceLocator implements SourceLocator
|
|||
public function locateIdentifiersByType(Reflector $reflector, IdentifierType $identifierType) : array
|
||||
{
|
||||
$sourceLocator = $this->dynamicSourceLocatorProvider->provide();
|
||||
$reflections = $sourceLocator->locateIdentifiersByType($reflector, $identifierType);
|
||||
try {
|
||||
$reflections = $sourceLocator->locateIdentifiersByType($reflector, $identifierType);
|
||||
} catch (CouldNotReadFileException $exception) {
|
||||
return [];
|
||||
}
|
||||
if ($reflections !== []) {
|
||||
return $reflections;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user