diff options
Diffstat (limited to 'vendor/sabre/http/lib/RequestDecorator.php')
-rw-r--r-- | vendor/sabre/http/lib/RequestDecorator.php | 130 |
1 files changed, 39 insertions, 91 deletions
diff --git a/vendor/sabre/http/lib/RequestDecorator.php b/vendor/sabre/http/lib/RequestDecorator.php index 7ee3f6fc8..0ad24925f 100644 --- a/vendor/sabre/http/lib/RequestDecorator.php +++ b/vendor/sabre/http/lib/RequestDecorator.php @@ -1,9 +1,11 @@ <?php +declare(strict_types=1); + namespace Sabre\HTTP; /** - * Request Decorator + * Request Decorator. * * This helper class allows you to easily create decorators for the Request * object. @@ -12,99 +14,72 @@ namespace Sabre\HTTP; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class RequestDecorator implements RequestInterface { - +class RequestDecorator implements RequestInterface +{ use MessageDecoratorTrait; /** * Constructor. - * - * @param RequestInterface $inner */ - function __construct(RequestInterface $inner) { - + public function __construct(RequestInterface $inner) + { $this->inner = $inner; - } /** - * Returns the current HTTP method - * - * @return string + * Returns the current HTTP method. */ - function getMethod() { - + public function getMethod(): string + { return $this->inner->getMethod(); - } /** - * Sets the HTTP method - * - * @param string $method - * @return void + * Sets the HTTP method. */ - function setMethod($method) { - + public function setMethod(string $method) + { $this->inner->setMethod($method); - } /** * Returns the request url. - * - * @return string */ - function getUrl() { - + public function getUrl(): string + { return $this->inner->getUrl(); - } /** * Sets the request url. - * - * @param string $url - * @return void */ - function setUrl($url) { - + public function setUrl(string $url) + { $this->inner->setUrl($url); - } /** * Returns the absolute url. - * - * @return string */ - function getAbsoluteUrl() { - + public function getAbsoluteUrl(): string + { return $this->inner->getAbsoluteUrl(); - } /** * Sets the absolute url. - * - * @param string $url - * @return void */ - function setAbsoluteUrl($url) { - + public function setAbsoluteUrl(string $url) + { $this->inner->setAbsoluteUrl($url); - } /** * Returns the current base url. - * - * @return string */ - function getBaseUrl() { - + public function getBaseUrl(): string + { return $this->inner->getBaseUrl(); - } /** @@ -113,14 +88,10 @@ class RequestDecorator implements RequestInterface { * This url is used for relative path calculations. * * The base url should default to / - * - * @param string $url - * @return void */ - function setBaseUrl($url) { - + public function setBaseUrl(string $url) + { $this->inner->setBaseUrl($url); - } /** @@ -137,39 +108,30 @@ class RequestDecorator implements RequestInterface { * ISO-8859-1, it will convert it to UTF-8. * * If the path is outside of the base url, a LogicException will be thrown. - * - * @return string */ - function getPath() { - + public function getPath(): string + { return $this->inner->getPath(); - } /** * Returns the list of query parameters. * * This is equivalent to PHP's $_GET superglobal. - * - * @return array */ - function getQueryParameters() { - + public function getQueryParameters(): array + { return $this->inner->getQueryParameters(); - } /** * Returns the POST data. * * This is equivalent to PHP's $_POST superglobal. - * - * @return array */ - function getPostData() { - + public function getPostData(): array + { return $this->inner->getPostData(); - } /** @@ -179,53 +141,39 @@ class RequestDecorator implements RequestInterface { * * This would not have been needed, if POST data was accessible as * php://input, but unfortunately we need to special case it. - * - * @param array $postData - * @return void */ - function setPostData(array $postData) { - + public function setPostData(array $postData) + { $this->inner->setPostData($postData); - } - /** * Returns an item from the _SERVER array. * * If the value does not exist in the array, null is returned. * - * @param string $valueName * @return string|null */ - function getRawServerValue($valueName) { - + public function getRawServerValue(string $valueName) + { return $this->inner->getRawServerValue($valueName); - } /** * Sets the _SERVER array. - * - * @param array $data - * @return void */ - function setRawServerData(array $data) { - + public function setRawServerData(array $data) + { $this->inner->setRawServerData($data); - } /** * Serializes the request object as a string. * * This is useful for debugging purposes. - * - * @return string */ - function __toString() { - + public function __toString(): string + { return $this->inner->__toString(); - } } |