shopware-rector
shopware-rector copied to clipboard
AbstractMessageHandler
Please describe the feature you would like to see implemented.
It would be nice, if the old AbstractMessageHandler could be migrated to AsMessageHandler attribute
@tinect @shyim Needed this as well, i've wrote a working rule for it. To be honest, it's 99% generated by gpt-4, but it does work. Could be a starting point :-)
It does the following:
- Removes extends statement and adds Attribute "AsMessageHandler"
- Searches for any method name containing "message", implements __invoke method and calls this function
- Removes getHandledMessages method
- Adds import for AsMessageHandler if not present
Works in my case, however i am still refactoring and can't say its production-ready :-)
See https://github.com/alexschwarz89/shopware-rector/commit/6ee17addd9f9c85b9c8f8d3edebe746d8fa3ba72
Hey,
do you want to create a PR. looks okay for me :)