sulu/sulu-rector

XML Template Update

alexander-schranz opened this issue · 4 comments

Add possibility to update xml templates. Via some rector processor.

-<controller>Sulu\Bundle\ArticleBundle\Controller\WebsiteArticleController:indexAction</controller>
+<controller>Sulu\Bundle\ArticleBundle\Controller\WebsiteArticleController::indexAction</controller>

@alexander-schranz I think that can be accomplished with a custom FileProcessor for xml files.
Have a look at: https://github.com/sabbelasichon/typo3-rector/blob/main/src/FileProcessor/FlexForms/FlexFormsProcessor.php

@sabbelasichon thx for the response and your insights how you handle this in Typo3. Looks like this is just a file visitor then?
Do you know if there is there any AST based fileprocessor for yaml, xml already available?

If I understand rector 0.18 release correctly non PHP Files rectors are not longer supported now: https://getrector.com/blog/rector-018-refocus-on-php. @TomasVotruba deprecated them in rectorphp/rector-src#4761.

Not sure if there will be still a hook where we could upgrade other files or if we need for every file format binary doing the upgrade.

@sabbelasichon what are your plans here with the upgrade path for such files?

@alexander-schranz I am a bit late in responding. Sorry for that. We are currently developing a new tool to handle changes of non php files (https://github.com/andreaswolf/fractor). It is still under active development but we are expecting to have something ready end of June.