A
A
Alexander Vladimirovich2021-09-24 14:51:37
PHP
Alexander Vladimirovich, 2021-09-24 14:51:37

Is there an annotation to attribute converter?

Greetings!
Switching to PHP 8 and Symfony 5.2
from PHP 7.4 and Symfony 4.4
Previously, annotations were used everywhere, including custom ones, and doctrines, and routing
I want to convert everything to PHP 8 attributes
Maybe there is an automatic annotation-to-attribute converter?
Lots of manual work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2021-09-24
@polyanin

Look at Rector , it's specifically designed for this kind of manipulation. There are separate packages with rules for Symfony and Doctrine , but some rules will probably have to be added. Well, an article on the topic .
Most likely, you won’t translate everything directly completely automatically, if only because there is no full-fledged replacement for complex Doctrine annotations on attributes now due to the lack of nesting support for attributes. I didn’t track what the Doctrine developers decided about this, it’s worth asking.
Yes, and Symfony 5.2 is already out of support , you need to aim for 5.4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question