File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
components/event_dispatcher Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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!');
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments