Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute "Doctrine\ORM\Mapping\Entity" must not be repeated #8582

Closed
FrancoFasano opened this issue Apr 2, 2024 · 2 comments
Closed

Attribute "Doctrine\ORM\Mapping\Entity" must not be repeated #8582

FrancoFasano opened this issue Apr 2, 2024 · 2 comments

Comments

@FrancoFasano
Copy link

Hi,
I run the rector.php to migrate annotations to attributes on a symfony 5.4 project and this issue occured in
AttributeReader.php line 115 :
Attribute "Doctrine\ORM\Mapping\Entity" must not be repeated

I don't know how to fix it.
Do you know what is the origin of this error?

This is the rector.php file created for migration :

`<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;

use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Symfony\Set\SymfonySetList;

return function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
// DIR . '/src/Entity',
DIR . '/config',
DIR . '/public',
DIR . '/src',
DIR . '/tests',
]);
$rectorConfig->sets([
\Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
\Rector\Symfony\Set\SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
\Rector\Symfony\Set\SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
new AnnotationToAttribute(\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity::class),
new AnnotationToAttribute(\Ibericode\Vat\Bundle\Validator\Constraints\VatNumber::class),
]);
};
`

@TomasVotruba
Copy link
Member

Thank you for your report!

We'll need an isolated failing demo link from: http://getrector.com/demo,
that way we can reproduce the bug.

@TomasVotruba
Copy link
Member

Closing for lack of feedback. Thanks for understanding 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants