From: Tim Düsterhus Date: Thu, 19 May 2022 12:49:33 +0000 (+0200) Subject: Add `\wcf\http\LegacyPlaceholderResponse` X-Git-Tag: 6.0.0_Alpha_1~1266^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=594595c992e33987ad8e89aecca5ebdee1c37cc0;p=GitHub%2FWoltLab%2FWCF.git Add `\wcf\http\LegacyPlaceholderResponse` --- diff --git a/wcfsetup/install/files/lib/http/LegacyPlaceholderResponse.class.php b/wcfsetup/install/files/lib/http/LegacyPlaceholderResponse.class.php new file mode 100644 index 0000000000..f5e75b23af --- /dev/null +++ b/wcfsetup/install/files/lib/http/LegacyPlaceholderResponse.class.php @@ -0,0 +1,103 @@ + + * @package WoltLabSuite\Core\Http + * @since 5.6 + */ +final class LegacyPlaceholderResponse implements ResponseInterface +{ + private function throwException() + { + throw new \BadMethodCallException(\sprintf( + "Operating on a '%s' placeholder return value of legacy controller is not allowed, as the controller's response information is not available.", + self::class + )); + } + + public function getStatusCode() + { + $this->throwException(); + } + + public function withStatus($code, $reasonPhrase = '') + { + $this->throwException(); + } + + public function getReasonPhrase() + { + $this->throwException(); + } + + public function getProtocolVersion() + { + $this->throwException(); + } + + public function withProtocolVersion($version) + { + $this->throwException(); + } + + public function getHeaders() + { + $this->throwException(); + } + + public function hasHeader($name) + { + $this->throwException(); + } + + public function getHeader($name) + { + $this->throwException(); + } + + public function getHeaderLine($name) + { + $this->throwException(); + } + + public function withHeader($name, $value) + { + $this->throwException(); + } + + public function withAddedHeader($name, $value) + { + $this->throwException(); + } + + public function withoutHeader($name) + { + $this->throwException(); + } + + public function getBody() + { + $this->throwException(); + } + + public function withBody(StreamInterface $body) + { + $this->throwException(); + } +}