-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
5953 use kernel events constants #6591
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,14 +68,15 @@ and the second argument is the service's class name (which must implement | |
The ``EventSubscriberInterface`` is exactly as you would expect:: | ||
|
||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\HttpKernel\KernelEvents; | ||
// ... | ||
|
||
class StoreSubscriber implements EventSubscriberInterface | ||
{ | ||
public static function getSubscribedEvents() | ||
{ | ||
return array( | ||
'kernel.response' => array( | ||
KernelEvents::RESPONSE => array( | ||
array('onKernelResponsePre', 10), | ||
array('onKernelResponsePost', 0), | ||
), | ||
|
@@ -98,3 +99,4 @@ The ``EventSubscriberInterface`` is exactly as you would expect:: | |
// ... | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line should be removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my editor complained that it was needed; blank line is required after literal block |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,8 +150,9 @@ only if needed:: | |
namespace Simplex; | ||
|
||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | ||
use Symfony\Component\HttpKernel\KernelEvents; | ||
|
||
class StringResponseListener implements EventSubscriberInterface | ||
{ | ||
|
@@ -166,7 +167,7 @@ only if needed:: | |
|
||
public static function getSubscribedEvents() | ||
{ | ||
return array('kernel.view' => 'onView'); | ||
return array(KernelEvents::VIEW => 'onView'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add this use statement as well. |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the correct use statement on line 71