Updated Rector to commit df8d2b78edd46542e6426fec606c3ea98d712532

df8d2b78ed Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#8438) (#5603)
This commit is contained in:
Tomas Votruba 2024-02-11 23:33:46 +00:00
parent 1d69b60457
commit 12e1b38e32
7 changed files with 21 additions and 7 deletions

View File

@ -1679,12 +1679,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
"reference": "103f50de2efa5f5f4052b1fb7c39bfd08326cd6d"
"reference": "95876d8299ccb731dd2bdce5bcf197a3ddf2cedb"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/103f50de2efa5f5f4052b1fb7c39bfd08326cd6d",
"reference": "103f50de2efa5f5f4052b1fb7c39bfd08326cd6d",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/95876d8299ccb731dd2bdce5bcf197a3ddf2cedb",
"reference": "95876d8299ccb731dd2bdce5bcf197a3ddf2cedb",
"shasum": ""
},
"require": {
@ -1708,7 +1708,7 @@
"tomasvotruba\/unused-public": "^0.3",
"tracy\/tracy": "^2.10"
},
"time": "2024-02-11T21:28:40+00:00",
"time": "2024-02-11T23:31:10+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 103f50d'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 8d1aab2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main f091938'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 5a62f17'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 95876d8'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 8d1aab2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main f091938'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 5a62f17'));
private function __construct()
{
}

View File

@ -38,6 +38,10 @@ final class InheritanceClassAnnotationTransformer implements ClassAnnotationTran
$this->addDiscriminatorMap($classMapping['discriminatorMap'], $classPhpDocInfo);
}
}
public function getClassName() : string
{
return 'Doctrine\\ORM\\Mapping\\DiscriminatorMap';
}
/**
* @param array<string, mixed> $discriminatorColumn
*/
@ -54,7 +58,7 @@ final class InheritanceClassAnnotationTransformer implements ClassAnnotationTran
{
$arrayItemNodes = $this->arrayItemNodeFactory->create($discriminatorMap, [ArrayItemNodeFactory::QUOTE_ALL]);
$curlyListNode = new CurlyListNode($arrayItemNodes);
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode([$curlyListNode], 'Doctrine\\ORM\\Mapping\\DiscriminatorMap');
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode([$curlyListNode], $this->getClassName());
$classPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
}
}

View File

@ -51,6 +51,10 @@ final class YamlToAnnotationTransformer
{
$classPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
foreach ($this->classAnnotationTransformers as $classAnnotationTransformer) {
// already added
if ($classPhpDocInfo->hasByAnnotationClass($classAnnotationTransformer->getClassName())) {
continue;
}
$classAnnotationTransformer->transform($entityMapping, $classPhpDocInfo);
}
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($class);
@ -60,6 +64,10 @@ final class YamlToAnnotationTransformer
foreach ($class->getProperties() as $property) {
$propertyPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
foreach ($this->propertyAnnotationTransformers as $propertyAnnotationTransformer) {
// already added
if ($propertyPhpDocInfo->hasByAnnotationClass($propertyAnnotationTransformer->getClassName())) {
continue;
}
$propertyAnnotationTransformer->transform($entityMapping, $propertyPhpDocInfo, $property);
}
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($property);

View File

@ -7,5 +7,6 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
interface ClassAnnotationTransformerInterface
{
public function getClassName() : string;
public function transform(EntityMapping $entityMapping, PhpDocInfo $propertyPhpDocInfo) : void;
}

View File

@ -8,5 +8,6 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
interface PropertyAnnotationTransformerInterface
{
public function getClassName() : string;
public function transform(EntityMapping $entityMapping, PhpDocInfo $propertyPhpDocInfo, Property $property) : void;
}