code: private function headers(ResponseInterface $response): void
          {
              if (!headers_sent()) {
                  
                  foreach ($response->getHeaders() as $name => $values) {
                      $cookie = stripos($name, 'Set-Cookie') === 0 ? false : true;
                      foreach ($values as $value) {
                          header(sprintf('%s: %s', $name, $value), $cookie);
                          $cookie = false;
                      
                      }
                  }
  
                  header(sprintf(
                      'HTTP/%s %s %s',
                      $response->getProtocolVersion(),
                      $response->getStatusCode(),
                      $response->getReasonPhrase()
                  ), true, $response->getStatusCode());
  
              }
          }
docs: Emits headers, protocol, status code and reason
  phrase from response.
  
  @param ResponseInterface $response
  @return void