Code Monkey home page Code Monkey logo

Comments (5)

frankdejonge avatar frankdejonge commented on May 20, 2024

@lulco for my understanding, why would you use a mechanism to provide an alternative name and then not use an alternative name?

from event.

lulco avatar lulco commented on May 20, 2024

@frankdejonge I don't know, just because I can :) I just fall into this when I was trying to upgrade package to version 3.0 but still keep old classes Event and AbstractEvent lived (I copy them into my project in faith that upgrade will be more easy - no need to delete non existing parent from all of my events etc).

Not sure if you understand my train of thought :) If you have any additional question, I will try to answer.

from event.

frankdejonge avatar frankdejonge commented on May 20, 2024

@lulco if you use class names for your events, can't you just remove the named event interface from the abstract event and remove the getName getter? The dispatcher exposes two mechanisms to signal interested parties and you use both with the same value, so I'm not surprised. It could be prevented by checking if the name is the same as the class name and then skipping invocation, but the usage you are describing is redundant and not intended, so I do not want to cater for a case that shouldn't exist in the first place. I'm all for wanting to be a lazy developer, but I'm even more for not putting in supports for situations that make no sense in my opinion.

from event.

lulco avatar lulco commented on May 20, 2024

Yes, probably I can and it is the way how to fix it.

I just wanted you to know about it and (maybe) add some prevention to code or at least some notice to docs.

Anyway, thank you for your quick reply. I'll close the issue and PR.

And one more thing. Yesterday I've added this package to rector which could help users to upgrade faster (it should help with renaming, adding and removing classes / interfaces).

from event.

frankdejonge avatar frankdejonge commented on May 20, 2024

@lulco oh nice! That looks very useful 👍 I'll close the issue and the PR. Feel free to add another PR with a link to your rector for in the readme and or docs.

from event.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.