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

[Feature Request] YamlToAttributeSymfonyValidatorRector #9019

Open
gnutix opened this issue Feb 12, 2025 · 1 comment
Open

[Feature Request] YamlToAttributeSymfonyValidatorRector #9019

gnutix opened this issue Feb 12, 2025 · 1 comment
Labels

Comments

@gnutix
Copy link
Contributor

gnutix commented Feb 12, 2025

Feature Request

Hello there!

While doing some profiling on my application, I found out a lot of time was spent parsing a YAML file of ~1300 lines that defines Symfony Validator constraints for objects in our legacy folder. I thought it would be better to migrate them to attributes, and searched for a Rector that would do the job. Apparently there's none yet, but Doctrine's YamlToAttributeDoctrineMappingRector seems to do something quite similar.

I was wondering if anyone here would have the knowledge to implement this feature, or help me try to implement it ?
Or should it be a separate script like https://github.com/symplify/config-transformer ?

gnutix

@gnutix gnutix added the feature label Feb 12, 2025
@TomasVotruba
Copy link
Member

Hey, I think best way is to copy YamlToAttributeDoctrineMappingRector behavior and adding it's symfony/validator attributes counterbehavior.

The https://github.com/symplify/config-transformer is designed exlusively for YML to PHP 1:1 configs. Not suitable here.

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

No branches or pull requests

2 participants