Compare commits

..

No commits in common. "1c323223b243277088534ca4b70cf3755b6524c9" and "584e892a51b0cbeb2aa5dbf1a8c4c550cb9da3b2" have entirely different histories.

7 changed files with 12 additions and 30 deletions

View File

@ -1679,12 +1679,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
"reference": "9e0a97b087071637e35eda5c7596704ee137a082"
"reference": "b3da143634de79b24a266afc07401cfe75a2c49c"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/9e0a97b087071637e35eda5c7596704ee137a082",
"reference": "9e0a97b087071637e35eda5c7596704ee137a082",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/b3da143634de79b24a266afc07401cfe75a2c49c",
"reference": "b3da143634de79b24a266afc07401cfe75a2c49c",
"shasum": ""
},
"require": {
@ -1709,7 +1709,7 @@
"tomasvotruba\/unused-public": "^0.3",
"tracy\/tracy": "^2.10"
},
"time": "2024-04-21T12:41:39+00:00",
"time": "2024-03-22T00:11:46+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 9e0a97b'), '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 05e44cf'), '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 e8af39b'), '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 b8126e8'));
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 b3da143'), '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 05e44cf'), '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 e8af39b'), '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 b8126e8'));
private function __construct()
{
}

View File

@ -37,19 +37,11 @@ final class TableClassAttributeTransformer implements ClassAttributeTransformerI
$args[] = AttributeFactory::createNamedArg(new String_($table), 'name');
}
$class->attrGroups[] = AttributeFactory::createGroup($this->getClassName(), $args);
$this->addIndexes($classMapping['indexes'] ?? [], $class, MappingClass::INDEX);
$this->addIndexes($classMapping['uniqueConstraints'] ?? [], $class, MappingClass::UNIQUE_CONSTRAINT);
}
/**
* @param array<string, array<string, mixed>> $mapping
* @param MappingClass::* $attribute
*/
private function addIndexes(array $mapping, Class_ $class, string $attribute) : void
{
foreach ($mapping as $name => $values) {
$values = \array_merge(['name' => $name], $values);
$args = $this->nodeFactory->createArgs($values);
$class->attrGroups[] = AttributeFactory::createGroup($attribute, $args);
$uniqueConstraints = $classMapping['uniqueConstraints'] ?? [];
foreach ($uniqueConstraints as $name => $uniqueConstraint) {
$uniqueConstraint = \array_merge(['name' => $name], $uniqueConstraint);
$args = $this->nodeFactory->createArgs($uniqueConstraint);
$class->attrGroups[] = AttributeFactory::createGroup(MappingClass::UNIQUE_CONSTRAINT, $args);
}
}
public function getClassName() : string

View File

@ -31,12 +31,6 @@ final class JoinColumnAttributeTransformer implements PropertyAttributeTransform
if (!\is_array($manyToOnePropertyMapping)) {
return;
}
$singleJoinColumn = $manyToOnePropertyMapping['joinColumn'] ?? null;
if (\is_array($singleJoinColumn)) {
$name = $singleJoinColumn['name'];
unset($singleJoinColumn['name']);
$manyToOnePropertyMapping['joinColumns'][$name] = $singleJoinColumn;
}
$joinColumns = $manyToOnePropertyMapping['joinColumns'] ?? null;
if (!\is_array($joinColumns)) {
return;

View File

@ -33,7 +33,7 @@ final class ManyToOneAttributeTransformer implements PropertyAttributeTransforme
return;
}
// handled by another mapper
unset($manyToOneMapping['joinColumn'], $manyToOneMapping['joinColumns']);
unset($manyToOneMapping['joinColumns']);
// non existing
unset($manyToOneMapping['nullable']);
$args = $this->nodeFactory->createArgs($manyToOneMapping);

View File

@ -53,10 +53,6 @@ final class MappingClass
* @var string
*/
public const GENERATED_VALUE = 'Doctrine\\ORM\\Mapping\\GeneratedValue';
/**
* @var string
*/
public const INDEX = 'Doctrine\\ORM\\Mapping\\Index';
/**
* @var string
*/