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鈥檒l 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 1 commit into from Jul 8, 2017


None yet
2 participants

BrandonShar commented Jul 8, 2017

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 馃槃

Brandon Shar

@BrandonShar BrandonShar changed the title from [5.5] Use $listensFor instead of $hears for event listener self-registration to [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

2 checks passed

continuous-integration/styleci/pr The StyleCI analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Show comment
Hide comment

taylorotwell Jul 8, 2017


Sure, whatever.


taylorotwell commented Jul 8, 2017

Sure, whatever.

@BrandonShar BrandonShar deleted the BrandonShar:change-name-of-hears branch Jul 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment