mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit 5edb023974a55b0efee74dd9fe92b314dd521f2c
5edb023974
fix config for configured rule
This commit is contained in:
parent
ae1e3ab8ca
commit
18992ab52d
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -1679,12 +1679,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "ad3117de1cad30f0eed35b2250eb501803d46d15"
|
||||
"reference": "31f9653edf768a6e61e59783baa64d15ddabf7e9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/ad3117de1cad30f0eed35b2250eb501803d46d15",
|
||||
"reference": "ad3117de1cad30f0eed35b2250eb501803d46d15",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/31f9653edf768a6e61e59783baa64d15ddabf7e9",
|
||||
"reference": "31f9653edf768a6e61e59783baa64d15ddabf7e9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1708,7 +1708,7 @@
|
||||
"tomasvotruba\/unused-public": "^0.3",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2024-02-12T09:09:54+00:00",
|
||||
"time": "2024-02-12T09:30:45+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"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
|
||||
{
|
||||
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 ad3117d'), '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 31f9653'), '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()
|
||||
{
|
||||
}
|
||||
|
@ -3,9 +3,11 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Doctrine\CodeQuality\AnnotationTransformer\PropertyAnnotationTransformer;
|
||||
|
||||
use Rector\BetterPhpDocParser\PhpDoc\SpacelessPhpDocTagNode;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
||||
use Rector\Doctrine\CodeQuality\Contract\PropertyAnnotationTransformerInterface;
|
||||
use Rector\Doctrine\CodeQuality\DocTagNodeFactory;
|
||||
use Rector\Doctrine\CodeQuality\NodeFactory\ArrayItemNodeFactory;
|
||||
@ -33,16 +35,28 @@ final class JoinColumnsTransformer implements PropertyAnnotationTransformerInter
|
||||
}
|
||||
$joinColumnArrayItemNodes = [];
|
||||
foreach ($joinColumns as $columnName => $joinColumn) {
|
||||
$joinColumn = \array_merge(['name' => $columnName], $joinColumn);
|
||||
$arrayItemNodes = $this->arrayItemNodeFactory->create($joinColumn, ['name', 'referencedColumnName']);
|
||||
$joinColumnSpacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, 'Doctrine\\ORM\\Mapping\\JoinColumn');
|
||||
$joinColumnSpacelessPhpDocTagNode = $this->createJoinColumnSpacelessTagValueNode($columnName, $joinColumn);
|
||||
$joinColumnArrayItemNodes[] = new ArrayItemNode($joinColumnSpacelessPhpDocTagNode);
|
||||
}
|
||||
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($joinColumnArrayItemNodes, $this->getClassName());
|
||||
if (\count($joinColumnArrayItemNodes) === 1) {
|
||||
$spacelessPhpDocTagNode = $joinColumnArrayItemNodes[0]->value;
|
||||
} else {
|
||||
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode([new CurlyListNode($joinColumnArrayItemNodes)], $this->getClassName());
|
||||
}
|
||||
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
||||
}
|
||||
public function getClassName() : string
|
||||
{
|
||||
return 'Doctrine\\ORM\\Mapping\\JoinColumns';
|
||||
}
|
||||
/**
|
||||
* @param int|string $columnName
|
||||
* @param mixed $joinColumn
|
||||
*/
|
||||
private function createJoinColumnSpacelessTagValueNode($columnName, $joinColumn) : SpacelessPhpDocTagNode
|
||||
{
|
||||
$joinColumn = \array_merge(['name' => $columnName], $joinColumn);
|
||||
$arrayItemNodes = $this->arrayItemNodeFactory->create($joinColumn, ['name', 'referencedColumnName']);
|
||||
return DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, 'Doctrine\\ORM\\Mapping\\JoinColumn');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user