public function __construct(StateInterface
$state) { $this->state =
$state;
} /**
* A simple kernel listener method.
*/
public function onKernelRequestTest(RequestEvent
$event) { \Drupal::
messenger()->
addStatus(t('The service_provider_test event subscriber fired!'
));
} /**
* Flags the response in case a rebuild indicator is used.
*/
public function onKernelResponseTest(ResponseEvent
$event) { if ($this->container->
hasParameter('container_rebuild_indicator'
)) { $event->
getResponse()->headers->
set('container_rebuild_indicator',
$this->container->
getParameter('container_rebuild_indicator'
));
} if ($this->container->
hasParameter('container_rebuild_test_parameter'
)) { $event->
getResponse()->headers->
set('container_rebuild_test_parameter',
$this->container->
getParameter('container_rebuild_test_parameter'
));
}