Comments (5)
@lulco for my understanding, why would you use a mechanism to provide an alternative name and then not use an alternative name?
from event.
@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.
@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.
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.
@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)
- How do you remove listeners?
- [docs] Typo in event/2.0/events/classes.md
- [docs] Typo in event/2.0/generator/trait.md
- Question: Can the Emitter be made ContainerAware? HOT 3
- Additional Arguments throw exception when using AbstractListener HOT 7
- Upcoming PSR HOT 3
- waitFor method HOT 4
- Ditch EventInterface HOT 5
- What is this repository for? HOT 1
- BufferedEmitter as service HOT 1
- Has this package been abandoned? HOT 2
- Fatal error: Uncaught Error: Class 'League\Event\Emitter' not found HOT 1
- New release? HOT 6
- Add the ability to have wildcard listener to be fired before all other listeners HOT 1
- Upgrade from 2 to 3 documentation is... incomplete... HOT 1
- What would be proper approach to add information to an event? HOT 2
- Stoppable Events HOT 5
- Is it possible to provide a working example? HOT 1
- Documentation issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from event.