Skip to content

Commit c522b17

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [EventDispatcher] Minor fixes
2 parents 3a7911c + ad3b6ff commit c522b17

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

components/event_dispatcher/generic_event.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ access the event arguments::
8080
{
8181
public function handler(GenericEvent $event)
8282
{
83-
if (isset($event['type']) && $event['type'] === 'foo') {
83+
if (isset($event['type']) && 'foo' === $event['type']) {
8484
// ... do something
8585
}
8686

event_dispatcher/before_after_filters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ serve as a basic flag that this request underwent token authentication::
189189
{
190190
// ...
191191

192-
if ($controller[0] instanceof TokenAuthenticatedController) {
192+
if ($controller instanceof TokenAuthenticatedController) {
193193
$token = $event->getRequest()->query->get('token');
194194
if (!in_array($token, $this->tokens)) {
195195
throw new AccessDeniedHttpException('This action needs a valid token!');

event_dispatcher/method_behavior.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end of the method::
2121
$event = new BeforeSendMailEvent($subject, $message);
2222
$this->dispatcher->dispatch($event, 'mailer.pre_send');
2323

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

@@ -134,7 +134,7 @@ could listen to the ``mailer.post_send`` event and change the method's return va
134134
public static function getSubscribedEvents()
135135
{
136136
return [
137-
'mailer.post_send' => 'onMailerPostSend'
137+
'mailer.post_send' => 'onMailerPostSend',
138138
];
139139
}
140140
}

0 commit comments

Comments
 (0)