mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
Updated Rector to commit 48e8cfab19f5572f6419876a8f5cec0109966862
48e8cfab19
[Php80] Support windows new line line DoctrineAnnotationDecorator::LONG_ANNOTATION_REGEX (#5610)
This commit is contained in:
parent
d1ca847d5b
commit
37b8c7c87c
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
|
@ -1679,12 +1679,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||||
"reference": "99da1d590539a3913594f5faea8e250255d2aa53"
|
"reference": "399fb713815e26651fbf90a5d4bd41f44bf4bb0e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/99da1d590539a3913594f5faea8e250255d2aa53",
|
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/399fb713815e26651fbf90a5d4bd41f44bf4bb0e",
|
||||||
"reference": "99da1d590539a3913594f5faea8e250255d2aa53",
|
"reference": "399fb713815e26651fbf90a5d4bd41f44bf4bb0e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1708,7 +1708,7 @@
|
||||||
"tomasvotruba\/unused-public": "^0.3",
|
"tomasvotruba\/unused-public": "^0.3",
|
||||||
"tracy\/tracy": "^2.10"
|
"tracy\/tracy": "^2.10"
|
||||||
},
|
},
|
||||||
"time": "2024-02-12T14:26:54+00:00",
|
"time": "2024-02-12T16:00:51+00:00",
|
||||||
"default-branch": true,
|
"default-branch": true,
|
||||||
"type": "rector-extension",
|
"type": "rector-extension",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||||
*/
|
*/
|
||||||
final class GeneratedConfig
|
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()
|
private function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
||||||
use Rector\Doctrine\CodeQuality\Contract\ClassAnnotationTransformerInterface;
|
use Rector\Doctrine\CodeQuality\Contract\ClassAnnotationTransformerInterface;
|
||||||
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
||||||
|
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
|
||||||
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
||||||
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
||||||
final class InheritanceClassAnnotationTransformer implements ClassAnnotationTransformerInterface
|
final class InheritanceClassAnnotationTransformer implements ClassAnnotationTransformerInterface
|
||||||
|
@ -47,7 +48,7 @@ final class InheritanceClassAnnotationTransformer implements ClassAnnotationTran
|
||||||
*/
|
*/
|
||||||
private function addDisriminatorColumn(array $discriminatorColumn, PhpDocInfo $classPhpDocInfo) : void
|
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');
|
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, 'Doctrine\\ORM\\Mapping\\DiscriminatorColumn');
|
||||||
$classPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
$classPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use PhpParser\Node\Stmt\Property;
|
||||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||||
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
|
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
|
||||||
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
||||||
|
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
|
||||||
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
||||||
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
||||||
final class ColumnAnnotationTransformer implements PropertyAnnotationTransformerInterface
|
final class ColumnAnnotationTransformer implements PropertyAnnotationTransformerInterface
|
||||||
|
@ -26,7 +27,12 @@ final class ColumnAnnotationTransformer implements PropertyAnnotationTransformer
|
||||||
if ($propertyMapping === null) {
|
if ($propertyMapping === null) {
|
||||||
return;
|
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());
|
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, $this->getClassName());
|
||||||
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use PhpParser\Node\Stmt\Property;
|
||||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||||
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
|
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
|
||||||
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
||||||
|
use Rector\Doctrine\CodeQuality\Enum\EntityMappingKey;
|
||||||
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
||||||
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
||||||
final class ManyToOneAnnotationTransformer implements PropertyAnnotationTransformerInterface
|
final class ManyToOneAnnotationTransformer implements PropertyAnnotationTransformerInterface
|
||||||
|
@ -26,7 +27,7 @@ final class ManyToOneAnnotationTransformer implements PropertyAnnotationTransfor
|
||||||
if (!\is_array($manyToOneMapping)) {
|
if (!\is_array($manyToOneMapping)) {
|
||||||
return;
|
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());
|
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, $this->getClassName());
|
||||||
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,10 @@ final class EntityMappingKey
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const COLUMN_PREFIX = 'columnPrefix';
|
public const COLUMN_PREFIX = 'columnPrefix';
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public const COLUMN = 'column';
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -25,4 +29,20 @@ final class EntityMappingKey
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const ORDER_BY = 'orderBy';
|
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';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user