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

AbstractMessageHandler #20

Open
tinect opened this issue Jun 19, 2023 · 2 comments
Open

AbstractMessageHandler #20

tinect opened this issue Jun 19, 2023 · 2 comments

Comments

@tinect
Copy link
Member

tinect commented Jun 19, 2023

Please describe the feature you would like to see implemented.

It would be nice, if the old AbstractMessageHandler could be migrated to AsMessageHandler attribute

alexschwarz89 added a commit to alexschwarz89/shopware-rector that referenced this issue Dec 1, 2023
@alexschwarz89
Copy link

alexschwarz89 commented Dec 1, 2023

@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:

  1. Removes extends statement and adds Attribute "AsMessageHandler"
  2. Searches for any method name containing "message", implements __invoke method and calls this function
  3. Removes getHandledMessages method
  4. Adds import for AsMessageHandler if not present

Works in my case, however i am still refactoring and can't say its production-ready :-)

See alexschwarz89@6ee17ad

@shyim
Copy link
Member

shyim commented Jun 8, 2024

Hey,

do you want to create a PR. looks okay for me :)

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

No branches or pull requests

3 participants