8000 Use a better name than "class Foo" by BafS · Pull Request #16634 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Use a better name than "class Foo" #16634

8000
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

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,9 @@ is dispatched, are passed as arguments to the listener::
use Symfony\Contracts\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class Foo
class MySubscriber
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not MyListener ? in ref to the above are passed as arguments to the listener

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both work for me but maybe we should update this sentence too: are passed as arguments to the listener/subscriber

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the end I changed this for MyListener and didn't add "subscriber" to the text description because this section only mentions listeners (there are other sections in this article that talk about subscribers). Cheers!

{
public function myEventListener(Event $event, $eventName, EventDispatcherInterface $dispatcher)
public function myEventListener(Event $event, string $eventName, EventDispatcherInterface $dispatcher)
{
// ... do something with the event name
}
Expand Down
0