/** * @param Request $request * @param Response $response */ public function __construct(Request $request, Response $response) { $this->scheme = $request->getScheme(); $this->host = $request->getHost(); $port = $request->getPort(); $this->response = $response; if ('http' === $this->scheme && 80 !== $port) { $this->host .= ':' . $port; } if ('https' === $this->scheme && 443 !== $port) { $this->host .= ':' . $port; } }