Zend\Mvc\SendResponseListener::attachDefaultListeners PHP Méthode

attachDefaultListeners() protected méthode

The order in which the response sender are listed here, is by their usage: PhpEnvironmentResponseSender has highest priority, because it's used most often. SimpleStreamResponseSender is not used that often, so has a lower priority. You can attach your response sender before or after every default response sender implementation. All default response sender implementation have negative priority. You are able to attach listeners without giving a priority and your response sender would be first to try.
protected attachDefaultListeners ( ) : SendResponseListener
Résultat SendResponseListener
    protected function attachDefaultListeners()
    {
        $events = $this->getEventManager();
        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new PhpEnvironmentResponseSender(), -1000);
        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new SimpleStreamResponseSender(), -3000);
        $events->attach(SendResponseEvent::EVENT_SEND_RESPONSE, new HttpResponseSender(), -4000);
    }