Skip to content

[EventDispatcher] Minor fixes #15289

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
Apr 24, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion components/event_dispatcher/generic_event.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ access the event arguments::
{
public function handler(GenericEvent $event)
{
if (isset($event['type']) && $event['type'] === 'foo') {
if (isset($event['type']) && 'foo' === $event['type']) {
// ... do something
}

Expand Down
2 changes: 1 addition & 1 deletion event_dispatcher/before_after_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ serve as a basic flag that this request underwent token authentication::
{
// ...

if ($controller[0] instanceof TokenAuthenticatedController) {
if ($controller instanceof TokenAuthenticatedController) {
$token = $event->getRequest()->query->get('token');
if (!in_array($token, $this->tokens)) {
throw new AccessDeniedHttpException('This action needs a valid token!');
Expand Down
4 changes: 2 additions & 2 deletions event_dispatcher/method_behavior.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end of the method::
$event = new BeforeSendMailEvent($subject, $message);
$this->dispatcher->dispatch($event, 'mailer.pre_send');

// get $foo and $bar from the event, they may have been modified
// get $subject and $message from the event, they may have been modified
$subject = $event->getSubject();
$message = $event->getMessage();

Expand Down Expand Up @@ -134,7 +134,7 @@ could listen to the ``mailer.post_send`` event and change the method's return va
public static function getSubscribedEvents()
{
return [
'mailer.post_send' => 'onMailerPostSend'
'mailer.post_send' => 'onMailerPostSend',
];
}
}
Expand Down