Updated Rector to commit 48e8cfab19f5572f6419876a8f5cec0109966862

48e8cfab19 [Php80] Support windows new line line DoctrineAnnotationDecorator::LONG_ANNOTATION_REGEX (#5610)
This commit is contained in:
Tomas Votruba 2024-02-12 16:03:52 +00:00
parent d1ca847d5b
commit 37b8c7c87c
7 changed files with 37 additions and 9 deletions

View File

@ -1679,12 +1679,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
"reference": "99da1d590539a3913594f5faea8e250255d2aa53"
"reference": "399fb713815e26651fbf90a5d4bd41f44bf4bb0e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/99da1d590539a3913594f5faea8e250255d2aa53",
"reference": "99da1d590539a3913594f5faea8e250255d2aa53",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/399fb713815e26651fbf90a5d4bd41f44bf4bb0e",
"reference": "399fb713815e26651fbf90a5d4bd41f44bf4bb0e",
"shasum": ""
},
"require": {
@ -1708,7 +1708,7 @@
"tomasvotruba\/unused-public": "^0.3",
"tracy\/tracy": "^2.10"
},
"time": "2024-02-12T14:26:54+00:00",
"time": "2024-02-12T16:00:51+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 99da1d5'), '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 cdbe390'), '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 59edb62'));
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 399fb71'), '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 cdbe390'), '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 59edb62'));
private function __construct()
{
}

View File

@ -8,6 +8,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
use Rector\Doctrine\CodeQuality\Contract\ClassAnnotationTransformerInterface;
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
final class InheritanceClassAnnotationTransformer implements ClassAnnotationTransformerInterface
@ -47,7 +48,7 @@ final class InheritanceClassAnnotationTransformer implements ClassAnnotationTran
*/
private function addDisriminatorColumn(array $discriminatorColumn, PhpDocInfo $classPhpDocInfo) : void
{
$arrayItemNodes = $this->arrayItemNodeFactory->create($discriminatorColumn, ['name', 'type']);
$arrayItemNodes = $this->arrayItemNodeFactory->create($discriminatorColumn, [EntityMappingKey::NAME, EntityMappingKey::TYPE]);
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, 'Doctrine\\ORM\\Mapping\\DiscriminatorColumn');
$classPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
}

View File

@ -7,6 +7,7 @@ use PhpParser\Node\Stmt\Property;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
final class ColumnAnnotationTransformer implements PropertyAnnotationTransformerInterface
@ -26,7 +27,12 @@ final class ColumnAnnotationTransformer implements PropertyAnnotationTransformer
if ($propertyMapping === null) {
return;
}
$arrayItemNodes = $this->arrayItemNodeFactory->create($propertyMapping, ['type']);
// rename to "name"
if (isset($propertyMapping[EntityMappingKey::COLUMN])) {
$propertyMapping[EntityMappingKey::NAME] = $propertyMapping[EntityMappingKey::COLUMN];
unset($propertyMapping[EntityMappingKey::COLUMN]);
}
$arrayItemNodes = $this->arrayItemNodeFactory->create($propertyMapping, [EntityMappingKey::TYPE, EntityMappingKey::NAME]);
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, $this->getClassName());
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
}

View File

@ -7,6 +7,7 @@ use PhpParser\Node\Stmt\Property;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
final class ManyToOneAnnotationTransformer implements PropertyAnnotationTransformerInterface
@ -26,7 +27,7 @@ final class ManyToOneAnnotationTransformer implements PropertyAnnotationTransfor
if (!\is_array($manyToOneMapping)) {
return;
}
$arrayItemNodes = $this->arrayItemNodeFactory->create($manyToOneMapping, ['targetEntity', 'inversedBy']);
$arrayItemNodes = $this->arrayItemNodeFactory->create($manyToOneMapping, [EntityMappingKey::TARGET_ENTITY, EntityMappingKey::INVERSED_BY]);
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, $this->getClassName());
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
}

View File

@ -13,6 +13,10 @@ final class EntityMappingKey
* @var string
*/
public const COLUMN_PREFIX = 'columnPrefix';
/**
* @var string
*/
public const COLUMN = 'column';
/**
* @var string
*/
@ -25,4 +29,20 @@ final class EntityMappingKey
* @var string
*/
public const ORDER_BY = 'orderBy';
/**
* @var string
*/
public const NAME = 'name';
/**
* @var string
*/
public const TYPE = 'type';
/**
* @var string
*/
public const INVERSED_BY = 'inversedBy';
/**
* @var string
*/
public const TARGET_ENTITY = 'targetEntity';
}