From d66f9c9dc5321d18b7fef44a3e0d63196463f040 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 13 Feb 2024 01:24:37 +0100 Subject: [PATCH] fix nullable on mebeddable --- .../config/yaml_mapping/embdded_mapping.yml | 1 + .../EmbeddedPropertyAnnotationTransformer.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/rules-tests/CodeQuality/Rector/Class_/YamlToAnnotationsDoctrineMappingRector/config/yaml_mapping/embdded_mapping.yml b/rules-tests/CodeQuality/Rector/Class_/YamlToAnnotationsDoctrineMappingRector/config/yaml_mapping/embdded_mapping.yml index b8921fdb..a98025f0 100644 --- a/rules-tests/CodeQuality/Rector/Class_/YamlToAnnotationsDoctrineMappingRector/config/yaml_mapping/embdded_mapping.yml +++ b/rules-tests/CodeQuality/Rector/Class_/YamlToAnnotationsDoctrineMappingRector/config/yaml_mapping/embdded_mapping.yml @@ -3,3 +3,4 @@ Rector\Doctrine\Tests\CodeQuality\Rector\Class_\YamlToAnnotationsDoctrineMapping inner: class: App\Currency columnPrefix: "currency_" + nullable: true diff --git a/rules/CodeQuality/AnnotationTransformer/PropertyAnnotationTransformer/EmbeddedPropertyAnnotationTransformer.php b/rules/CodeQuality/AnnotationTransformer/PropertyAnnotationTransformer/EmbeddedPropertyAnnotationTransformer.php index fabf5f3b..ec95a099 100644 --- a/rules/CodeQuality/AnnotationTransformer/PropertyAnnotationTransformer/EmbeddedPropertyAnnotationTransformer.php +++ b/rules/CodeQuality/AnnotationTransformer/PropertyAnnotationTransformer/EmbeddedPropertyAnnotationTransformer.php @@ -25,6 +25,8 @@ public function transform(EntityMapping $entityMapping, PhpDocInfo $propertyPhpD return; } + unset($propertyMapping['nullable']); + $arrayItemNodes = $this->arrayItemNodeFactory->create($propertyMapping, ['class', 'columnPrefix']); $spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode(