The LanguageRequestSubscriber listens to KernelEvents::REQUEST with a priority of 300:
/**
* Registers the methods in this class that should be listeners.
*
* @return array
* An array of event listener definitions.
*/
static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = array('onKernelRequestLanguage', 300);
return $events;
}
However, refer to these notes about Symfony priority: http://symfony.com/doc/current/cookbook/service_container/event_listener...
There is an additional tag option priority that is optional and defaults to 0. This value can be from -255 to 255, and the listeners will be executed in the order of their priority. This is useful when you need to guarantee that one listener is executed before another.
It appears that Symfony's codebase doesn't check whether priorities are in that range. However, since we don't need to use 300 for any particular reason, we may as well play along with the existing documentation.
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
0001-Change-listener-weight-to-conform-to-Symfony-standar.patch | 1.03 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 54,187 pass(es). | View details | Re-test |