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

Add failing test fixture for AnnotationToAttributeRector #225

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jun 14, 2021

@stephanvierkant I've rebased your fixture and fixed incorrect namespace possition and it is passing ✔️
Probably fixed already :)

Thank you for the PR 👍

@stephanvierkant
Copy link
Contributor

stephanvierkant commented Jun 15, 2021

This rector still doesn't work properly. It replaces \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity by \Doctrine\ORM\Mapping\Entity

-/**
- * @UniqueEntity(
- *     fields={"parent", "code"},
- *     errorPath="code",
- *     message="Already exists!",
- *     ignoreNull=false,
- *     groups={"default", "update"}
- * )
- */
 #[Table('Foo')]
-#[Entity]
+#[Entity]
+#[\Doctrine\ORM\Mapping\Entity(fields: ['parent', 'code'], errorPath: 'code', message: 'Already exists!', ignoreNull: false, groups: ['default', 'update'])]
 class Foo
-{}
+{}

(same demo link)

@samsonasik
Copy link
Member

@stephanvierkant could you try "rector/rector": "dev-main" ?

@stephanvierkant
Copy link
Contributor

I'm using the demo site. Or is it not running on dev-main?

@samsonasik
Copy link
Member

demo site is not running latest dev-main, demo site is running latest release. The check of latest release is per-3 days, see:

https://github.com/rectorphp/getrector.org/blob/18a090dd6d3376f928df7cb353d4d9e18d4228df/composer.json#L16

https://github.com/rectorphp/getrector.org/blob/18a090dd6d3376f928df7cb353d4d9e18d4228df/.github/workflows/per_three_day_pull_request_automatic_update.yaml#L7

@stephanvierkant
Copy link
Contributor

Tried on dev-main. Now @Gedmo\SortablePosition (which doesn't support attributes) got replaced by \Doctrine\ORM\Mapping\Table

-    /**
-     * @Gedmo\SortablePosition
-     */
     #[Column('position', type: 'integer')]
+    #[\Doctrine\ORM\Mapping\Table]
     protected int $position = 0;

@samsonasik
Copy link
Member

@stephanvierkant please create failing fixture for that, thank you.

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

Successfully merging this pull request may close these issues.

3 participants