From 594595c992e33987ad8e89aecca5ebdee1c37cc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 19 May 2022 14:49:33 +0200 Subject: [PATCH] Add `\wcf\http\LegacyPlaceholderResponse` --- .../http/LegacyPlaceholderResponse.class.php | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 wcfsetup/install/files/lib/http/LegacyPlaceholderResponse.class.php 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(); + } +} -- 2.20.1