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

[5.5] Use listensFor instead of hears for event listener self-registration #19962

Merged
merged 1 commit into from
Jul 8, 2017

Conversation

BrandonShar
Copy link
Contributor

I love the new feature introduced in #19917 and I wanted to make a naming suggestion, but I didn't see it until it was merged. There was a bit of discussion on that PR, but I'm sure Taylor and Mohammed get enough alerts without reading through closed PRs so I figured opening a new one would be the best way to propose it.

Here's my reasoning for the change copied from that thread: The reason I prefer $listensFor instead of $hears is that $listensFor is more active; it describes something that the object is actively doing, whereas $hears feels more passive. If I say I "hear" a particular sound, you would assume that I happen to be in the area when some sound is occurring. If I say I "listen for" a particular sound, you would assume that I am actively attentive while waiting for that sound to occur. We're setting up objects that specifically listen for certain events (and actively wait for them to occur), not just that hear the event activity around them.

@adamwathan , would love to hear your thoughts since you introduced the feature. Of course, close away if this seems too pedantic, but I find naming to worth a discussion since it's both difficult and important. I'll still use and enjoy the feature regardless, but I might scoff a bit when I add my listeners array 😄

@BrandonShar BrandonShar changed the title [5.5] Use $listensFor instead of $hears for event listener self-registration [5.5] Use listensFor instead of hears for event listener self-registration Jul 8, 2017
@taylorotwell taylorotwell merged commit fc33b1a into laravel:master Jul 8, 2017
@taylorotwell
Copy link
Member

Sure, whatever.

@BrandonShar BrandonShar deleted the change-name-of-hears branch July 8, 2017 01:44
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

Successfully merging this pull request may close these issues.

2 participants