diff --git a/rules-tests/TypeDeclaration/Rector/Class_/ObjectTypedPropertyFromJMSSerializerAttributeTypeRector/Fixture/skip_class_not_found.php.inc b/rules-tests/TypeDeclaration/Rector/Class_/ObjectTypedPropertyFromJMSSerializerAttributeTypeRector/Fixture/skip_class_not_found.php.inc new file mode 100644 index 00000000000..37d08b15dc9 --- /dev/null +++ b/rules-tests/TypeDeclaration/Rector/Class_/ObjectTypedPropertyFromJMSSerializerAttributeTypeRector/Fixture/skip_class_not_found.php.inc @@ -0,0 +1,11 @@ +staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PROPERTY); + $node = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PROPERTY); + + if ($node instanceof FullyQualified && ! $this->reflectionProvider->hasClass($node->toString())) { + return null; + } + + return $node; } public function createScalarTypeNode(string $typeValue, Property $property): ?Node