From 86a151128b59bfce132f558f43368f3113eaa217 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 18 Jul 2024 14:36:08 +0000 Subject: [PATCH] Updated Rector to commit d119ad269de4bea207c53173a5b21614c72f790f https://github.com/rectorphp/rector-src/commit/d119ad269de4bea207c53173a5b21614c72f790f Prevent uncaught class-not-found exceptions (#6160) --- src/Application/VersionResolver.php | 4 ++-- .../PhpDocParser/IdentifierPhpDocTypeMapper.php | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 364f1ee3418..d965d5fa5d6 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'a3f0b1f21f60b21e4f357d3c7e6187b14bfa3ed2'; + public const PACKAGE_VERSION = 'd119ad269de4bea207c53173a5b21614c72f790f'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-07-18 21:25:34'; + public const RELEASE_DATE = '2024-07-18 21:33:41'; /** * @var int */ diff --git a/src/StaticTypeMapper/PhpDocParser/IdentifierPhpDocTypeMapper.php b/src/StaticTypeMapper/PhpDocParser/IdentifierPhpDocTypeMapper.php index d4fcc160c15..e637357a133 100644 --- a/src/StaticTypeMapper/PhpDocParser/IdentifierPhpDocTypeMapper.php +++ b/src/StaticTypeMapper/PhpDocParser/IdentifierPhpDocTypeMapper.php @@ -131,7 +131,9 @@ final class IdentifierPhpDocTypeMapper implements PhpDocTypeMapperInterface // parent outside the class, e.g. in a function return new MixedType(); } - /** @var ClassReflection $classReflection */ + if (!$this->reflectionProvider->hasClass($className)) { + return new MixedType(); + } $classReflection = $this->reflectionProvider->getClass($className); $parentClassReflection = $classReflection->getParentClass(); if (!$parentClassReflection instanceof ClassReflection) { @@ -149,7 +151,9 @@ final class IdentifierPhpDocTypeMapper implements PhpDocTypeMapperInterface // static outside the class, e.g. in a function return new MixedType(); } - /** @var ClassReflection $classReflection */ + if (!$this->reflectionProvider->hasClass($className)) { + return new MixedType(); + } $classReflection = $this->reflectionProvider->getClass($className); return new StaticType($classReflection); }