diff --git a/src/AbstractMessage.php b/src/AbstractMessage.php index 4fbd423fba..3ee1d51adc 100644 --- a/src/AbstractMessage.php +++ b/src/AbstractMessage.php @@ -39,7 +39,7 @@ abstract class AbstractMessage extends Message * (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2) * * @param string $version (Must be 1.0, 1.1 or 2) - * @return AbstractMessage + * @return $this * @throws Exception\InvalidArgumentException */ public function setVersion($version) @@ -69,7 +69,7 @@ public function getVersion() * * @see getHeaders() * @param Headers $headers - * @return AbstractMessage + * @return $this */ public function setHeaders(Headers $headers) { diff --git a/src/Client.php b/src/Client.php index d7722e461d..7626f7756e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -152,7 +152,7 @@ public function __construct($uri = null, $options = null) * Set configuration parameters for this HTTP client * * @param array|Traversable $options - * @return Client + * @return $this * @throws Client\Exception\InvalidArgumentException */ public function setOptions($options = []) @@ -184,7 +184,7 @@ public function setOptions($options = []) * separated from ->request() to preserve logic and readability * * @param Client\Adapter\AdapterInterface|string $adapter - * @return Client + * @return $this * @throws Client\Exception\InvalidArgumentException */ public function setAdapter($adapter) @@ -212,7 +212,7 @@ public function setAdapter($adapter) /** * Load the connection adapter * - * @return Client\Adapter\AdapterInterface $adapter + * @return Client\Adapter\AdapterInterface */ public function getAdapter() { @@ -227,7 +227,7 @@ public function getAdapter() * Set request * * @param Request $request - * @return Client + * @return $this */ public function setRequest(Request $request) { @@ -253,7 +253,7 @@ public function getRequest() * Set response * * @param Response $response - * @return Client + * @return $this */ public function setResponse(Response $response) { @@ -308,7 +308,7 @@ public function getRedirectionsCount() * Set Uri (to the request) * * @param string|Http $uri - * @return Client + * @return $this */ public function setUri($uri) { @@ -356,7 +356,7 @@ public function getUri() * Set the HTTP method (to the request) * * @param string $method - * @return Client + * @return $this */ public function setMethod($method) { @@ -395,7 +395,7 @@ public function getMethod() * Set the query string argument separator * * @param string $argSeparator - * @return Client + * @return $this */ public function setArgSeparator($argSeparator) { @@ -423,7 +423,7 @@ public function getArgSeparator() * * @param string $encType * @param string $boundary - * @return Client + * @return $this */ public function setEncType($encType, $boundary = null) { @@ -454,7 +454,7 @@ public function getEncType() * Set raw body (for advanced use cases) * * @param string $body - * @return Client + * @return $this */ public function setRawBody($body) { @@ -466,7 +466,7 @@ public function setRawBody($body) * Set the POST parameters * * @param array $post - * @return Client + * @return $this */ public function setParameterPost(array $post) { @@ -478,7 +478,7 @@ public function setParameterPost(array $post) * Set the GET parameters * * @param array $query - * @return Client + * @return $this */ public function setParameterGet(array $query) { @@ -491,7 +491,7 @@ public function setParameterGet(array $query) * * @param bool $clearCookies Also clear all valid cookies? (defaults to false) * @param bool $clearAuth Also clear http authentication? (defaults to true) - * @return Client + * @return $this */ public function resetParameters($clearCookies = false /*, $clearAuth = true */) { @@ -559,7 +559,7 @@ protected function getCookieId($cookie) * @param string $maxAge * @param string $version * @throws Exception\InvalidArgumentException - * @return Client + * @return $this */ public function addCookie( $cookie, @@ -606,7 +606,7 @@ public function addCookie( * * @param array|SetCookie[] $cookies Cookies as name=>value pairs or instances of SetCookie. * @throws Exception\InvalidArgumentException - * @return Client + * @return $this */ public function setCookies($cookies) { @@ -638,7 +638,7 @@ public function clearCookies() * * @param Headers|array $headers * @throws Exception\InvalidArgumentException - * @return Client + * @return $this */ public function setHeaders($headers) { @@ -693,7 +693,7 @@ public function getHeader($name) * Set streaming for received data * * @param string|bool $streamfile Stream file, true for temp file, false/null for no streaming - * @return \Zend\Http\Client + * @return $this */ public function setStream($streamfile = true) { @@ -717,8 +717,8 @@ public function getStream() /** * Create temporary stream * - * @throws Exception\RuntimeException * @return resource + * @throws Exception\RuntimeException */ protected function openTempStream() { @@ -753,7 +753,7 @@ protected function openTempStream() * @param string $password * @param string $type * @throws Exception\InvalidArgumentException - * @return Client + * @return $this */ public function setAuth($user, $password, $type = self::AUTH_BASIC) { @@ -865,7 +865,7 @@ public function dispatch(Stdlib\RequestInterface $request, Stdlib\ResponseInterf /** * Send HTTP request * - * @param Request $request + * @param Request|null $request * @return Response * @throws Exception\RuntimeException * @throws Client\Exception\RuntimeException @@ -1043,7 +1043,7 @@ public function send(Request $request = null) /** * Fully reset the HTTP client (auth, cookies, request, response, etc.) * - * @return Client + * @return $this */ public function reset() { @@ -1071,7 +1071,7 @@ public function reset() * @param string $data Data to send (if null, $filename is read and sent) * @param string $ctype Content type to use (if $data is set and $ctype is * null, will be application/octet-stream) - * @return Client + * @return $this * @throws Exception\RuntimeException */ public function setFileUpload($filename, $formname, $data = null, $ctype = null) @@ -1154,8 +1154,8 @@ protected function prepareCookies($domain, $path, $secure) * * @param resource|string $body * @param Http $uri - * @throws Exception\RuntimeException * @return array + * @throws Exception\RuntimeException */ protected function prepareHeaders($body, $uri) { @@ -1499,7 +1499,5 @@ public static function encodeAuthHeader($user, $password, $type = self::AUTH_BAS $type )); } - - return; } } diff --git a/src/Client/Adapter/Curl.php b/src/Client/Adapter/Curl.php index 4ff1681dcd..ff0e7cae1b 100644 --- a/src/Client/Adapter/Curl.php +++ b/src/Client/Adapter/Curl.php @@ -101,7 +101,7 @@ public function __construct() * Set the configuration array for the adapter * * @param array|Traversable $options - * @return Curl + * @return $this * @throws AdapterException\InvalidArgumentException */ public function setOptions($options = []) @@ -168,7 +168,7 @@ public function getConfig() * * @param string|int $option * @param mixed $value - * @return Curl + * @return $this */ public function setCurlOption($option, $value) { @@ -553,7 +553,7 @@ public function getHandle() * Set output stream for the response * * @param resource $stream - * @return Curl + * @return $this */ public function setOutputStream($stream) { diff --git a/src/Client/Adapter/Socket.php b/src/Client/Adapter/Socket.php index 7d0ceb62fb..a443f40fdc 100644 --- a/src/Client/Adapter/Socket.php +++ b/src/Client/Adapter/Socket.php @@ -143,7 +143,7 @@ public function getConfig() * * @param mixed $context Stream context or array of context options * @throws Exception\InvalidArgumentException - * @return Socket + * @return $this */ public function setStreamContext($context) { diff --git a/src/Cookies.php b/src/Cookies.php index b691baeb43..0f44b8ef18 100644 --- a/src/Cookies.php +++ b/src/Cookies.php @@ -338,7 +338,7 @@ protected function _matchPath($domains, $path) * * @param Response $response HTTP Response object * @param Uri\Uri|string $refUri The requested URI - * @return Cookies + * @return static * @todo Add the $uri functionality. */ public static function fromResponse(Response $response, $refUri) @@ -361,7 +361,7 @@ public function isEmpty() /** * Empties the cookieJar of any cookie * - * @return Cookies + * @return $this */ public function reset() { diff --git a/src/Header/AbstractAccept.php b/src/Header/AbstractAccept.php index dfda9a2b2f..8d7ecb672a 100644 --- a/src/Header/AbstractAccept.php +++ b/src/Header/AbstractAccept.php @@ -77,7 +77,7 @@ public function parseHeaderLine($headerLine) * Factory method: parse Accept header string * * @param string $headerLine - * @return Accept + * @return static */ public static function fromString($headerLine) { @@ -242,7 +242,7 @@ function ($v) { * @param int|float $priority * @param array (optional) $params * @throws Exception\InvalidArgumentException - * @return Accept + * @return $this */ protected function addType($type, $priority = 1, array $params = []) { diff --git a/src/Header/AbstractDate.php b/src/Header/AbstractDate.php index 167327cf7d..001a907cb8 100644 --- a/src/Header/AbstractDate.php +++ b/src/Header/AbstractDate.php @@ -65,7 +65,7 @@ abstract class AbstractDate implements HeaderInterface * Create date-based header from string * * @param string $headerLine - * @return AbstractDate + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -90,9 +90,7 @@ public static function fromString($headerLine) * Create date-based header from strtotime()-compatible string * * @param int|string $time - * - * @return self - * + * @return static * @throws Exception\InvalidArgumentException */ public static function fromTimeString($time) @@ -104,9 +102,7 @@ public static function fromTimeString($time) * Create date-based header from Unix timestamp * * @param int $time - * - * @return self - * + * @return static * @throws Exception\InvalidArgumentException */ public static function fromTimestamp($time) @@ -156,7 +152,7 @@ public static function getDateFormat() * Set the date for this header, this can be a string or an instance of \DateTime * * @param string|DateTime $date - * @return AbstractDate + * @return $this * @throws Exception\InvalidArgumentException */ public function setDate($date) diff --git a/src/Header/AbstractLocation.php b/src/Header/AbstractLocation.php index d879fb8ac8..c6e3122e85 100644 --- a/src/Header/AbstractLocation.php +++ b/src/Header/AbstractLocation.php @@ -35,7 +35,7 @@ abstract class AbstractLocation implements HeaderInterface * Create location-based header from string * * @param string $headerLine - * @return AbstractLocation + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -62,7 +62,7 @@ public static function fromString($headerLine) * Set the URI/URL for this header, this can be a string or an instance of Zend\Uri\Http * * @param string|UriInterface $uri - * @return AbstractLocation + * @return $this * @throws Exception\InvalidArgumentException */ public function setUri($uri) diff --git a/src/Header/Accept.php b/src/Header/Accept.php index 9b9fe60220..19d131dcaf 100644 --- a/src/Header/Accept.php +++ b/src/Header/Accept.php @@ -47,7 +47,7 @@ public function toString() * @param string $type * @param int|float $priority * @param array $params - * @return Accept + * @return $this */ public function addMediaType($type, $priority = 1, array $params = []) { diff --git a/src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php b/src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php index 2082b23156..95e2020cfc 100644 --- a/src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php +++ b/src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php @@ -38,7 +38,7 @@ public function __construct($internalValues) * Set a Field Value Part this Field Value Part matched against. * * @param AbstractFieldValuePart $matchedAgainst - * @return AbstractFieldValuePart provides fluent interface + * @return $this */ public function setMatchedAgainst(AbstractFieldValuePart $matchedAgainst) { diff --git a/src/Header/AcceptCharset.php b/src/Header/AcceptCharset.php index 21d2953651..8d196ec7a4 100644 --- a/src/Header/AcceptCharset.php +++ b/src/Header/AcceptCharset.php @@ -43,7 +43,7 @@ public function toString() * * @param string $type * @param int|float $priority - * @return Accept + * @return $this */ public function addCharset($type, $priority = 1) { diff --git a/src/Header/AcceptEncoding.php b/src/Header/AcceptEncoding.php index 791c2787ba..da1c960e47 100644 --- a/src/Header/AcceptEncoding.php +++ b/src/Header/AcceptEncoding.php @@ -43,7 +43,7 @@ public function toString() * * @param string $type * @param int|float $priority - * @return Accept + * @return $this */ public function addEncoding($type, $priority = 1) { diff --git a/src/Header/AcceptLanguage.php b/src/Header/AcceptLanguage.php index d1c33754b1..c8a90b2544 100644 --- a/src/Header/AcceptLanguage.php +++ b/src/Header/AcceptLanguage.php @@ -43,7 +43,7 @@ public function toString() * * @param string $type * @param int|float $priority - * @return Accept + * @return $this */ public function addLanguage($type, $priority = 1) { diff --git a/src/Header/Age.php b/src/Header/Age.php index 7d0bab82e1..85d68d1b04 100644 --- a/src/Header/Age.php +++ b/src/Header/Age.php @@ -25,7 +25,7 @@ class Age implements HeaderInterface * Create Age header from string * * @param string $headerLine - * @return Age + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -73,7 +73,7 @@ public function getFieldValue() * Set number of seconds * * @param int $delta - * @return RetryAfter + * @return $this */ public function setDeltaSeconds($delta) { diff --git a/src/Header/Allow.php b/src/Header/Allow.php index 9c0d225a3f..2e96a51d24 100644 --- a/src/Header/Allow.php +++ b/src/Header/Allow.php @@ -39,7 +39,7 @@ class Allow implements HeaderInterface * Create Allow header from header line * * @param string $headerLine - * @return Allow + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -102,7 +102,7 @@ public function getAllowedMethods() * Allow methods or list of methods * * @param array|string $allowedMethods - * @return Allow + * @return $this */ public function allowMethods($allowedMethods) { @@ -124,7 +124,7 @@ public function allowMethods($allowedMethods) * Disallow methods or list of methods * * @param array|string $disallowedMethods - * @return Allow + * @return $this */ public function disallowMethods($disallowedMethods) { @@ -146,7 +146,7 @@ public function disallowMethods($disallowedMethods) * Convenience alias for @see disallowMethods() * * @param array|string $disallowedMethods - * @return Allow + * @return $this */ public function denyMethods($disallowedMethods) { diff --git a/src/Header/CacheControl.php b/src/Header/CacheControl.php index 65d3dd3530..1aab3c009f 100644 --- a/src/Header/CacheControl.php +++ b/src/Header/CacheControl.php @@ -30,7 +30,7 @@ class CacheControl implements HeaderInterface * * @param string $headerLine * @throws Exception\InvalidArgumentException - * @return CacheControl + * @return static */ public static function fromString($headerLine) { @@ -83,7 +83,7 @@ public function isEmpty() * * @param string $key * @param string|bool $value - * @return CacheControl - provides the fluent interface + * @return $this */ public function addDirective($key, $value = true) { @@ -121,7 +121,7 @@ public function getDirective($key) * Remove a directive * * @param string $key - * @return CacheControl - provides the fluent interface + * @return $this */ public function removeDirective($key) { diff --git a/src/Header/Connection.php b/src/Header/Connection.php index 668946baa3..c376d31a76 100644 --- a/src/Header/Connection.php +++ b/src/Header/Connection.php @@ -26,7 +26,7 @@ class Connection implements HeaderInterface /** * @param string $headerLine - * @return Connection + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -49,7 +49,7 @@ public static function fromString($headerLine) * Set Connection header to define persistent connection * * @param bool $flag - * @return Connection + * @return $this */ public function setPersistent($flag) { @@ -74,7 +74,7 @@ public function isPersistent() * RFC allows any token as value, 'close' and 'keep-alive' are commonly used * * @param string $value - * @return Connection + * @return $this */ public function setValue($value) { diff --git a/src/Header/ContentSecurityPolicy.php b/src/Header/ContentSecurityPolicy.php index 3f268a1ee4..21402634e2 100644 --- a/src/Header/ContentSecurityPolicy.php +++ b/src/Header/ContentSecurityPolicy.php @@ -85,7 +85,7 @@ public function getDirectives() * * @param string $name The directive name. * @param array $sources The source list. - * @return self + * @return $this * @throws Exception\InvalidArgumentException If the name is not a valid directive name. */ public function setDirective($name, array $sources) @@ -134,7 +134,7 @@ public function setDirective($name, array $sources) * Create Content Security Policy header from a given header line * * @param string $headerLine The header line to parse. - * @return self + * @return static * @throws Exception\InvalidArgumentException If the name field in the given header line does not match. */ public static function fromString($headerLine) diff --git a/src/Header/ContentType.php b/src/Header/ContentType.php index b5b2522a64..bb4e490ef8 100644 --- a/src/Header/ContentType.php +++ b/src/Header/ContentType.php @@ -34,7 +34,7 @@ class ContentType implements HeaderInterface * Factory method: create an object from a string representation * * @param string $headerLine - * @return self + * @return static */ public static function fromString($headerLine) { @@ -155,7 +155,7 @@ public function getFieldValue() * Set the media type * * @param string $mediaType - * @return self + * @return $this */ public function setMediaType($mediaType) { @@ -179,7 +179,7 @@ public function getMediaType() * Set additional content-type parameters * * @param array $parameters - * @return self + * @return $this */ public function setParameters(array $parameters) { @@ -206,7 +206,7 @@ public function getParameters() * Set the content-type character set encoding * * @param string $charset - * @return self + * @return $this */ public function setCharset($charset) { diff --git a/src/Header/GenericHeader.php b/src/Header/GenericHeader.php index 933510981a..5311b7f2d0 100644 --- a/src/Header/GenericHeader.php +++ b/src/Header/GenericHeader.php @@ -25,15 +25,14 @@ class GenericHeader implements HeaderInterface /** * Factory to generate a header object from a string * - * @static * @param string $headerLine - * @return GenericHeader + * @return static */ public static function fromString($headerLine) { list($fieldName, $fieldValue) = GenericHeader::splitHeaderLine($headerLine); - $header = new static($fieldName, $fieldValue); - return $header; + + return new static($fieldName, $fieldValue); } /** @@ -80,7 +79,7 @@ public function __construct($fieldName = null, $fieldValue = null) * Set header field name * * @param string $fieldName - * @return GenericHeader + * @return $this * @throws Exception\InvalidArgumentException If the name does not match with RFC 2616 format. */ public function setFieldName($fieldName) @@ -122,7 +121,7 @@ public function getFieldName() * Set header field value * * @param string $fieldValue - * @return GenericHeader + * @return $this */ public function setFieldValue($fieldValue) { diff --git a/src/Header/HeaderInterface.php b/src/Header/HeaderInterface.php index 5e1156c47c..3814f97ef3 100644 --- a/src/Header/HeaderInterface.php +++ b/src/Header/HeaderInterface.php @@ -16,7 +16,7 @@ interface HeaderInterface * Factory to generate a header object from a string * * @param string $headerLine - * @return self + * @return static * @throws Exception\InvalidArgumentException If the header does not match RFC 2616 definition. * @see http://tools.ietf.org/html/rfc2616#section-4.2 */ diff --git a/src/Header/Referer.php b/src/Header/Referer.php index 82de01eca6..c810ef6d42 100644 --- a/src/Header/Referer.php +++ b/src/Header/Referer.php @@ -21,7 +21,7 @@ class Referer extends AbstractLocation * according to RFC Referer URI should not have fragment * * @param string|HttpUri $uri - * @return Referer + * @return $this */ public function setUri($uri) { diff --git a/src/Header/RetryAfter.php b/src/Header/RetryAfter.php index 7758ae8fa7..621c6fc448 100644 --- a/src/Header/RetryAfter.php +++ b/src/Header/RetryAfter.php @@ -26,7 +26,7 @@ class RetryAfter extends AbstractDate * Create Retry-After header from string * * @param string $headerLine - * @return RetryAfter + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) @@ -55,7 +55,7 @@ public static function fromString($headerLine) * Set number of seconds * * @param int $delta - * @return RetryAfter + * @return $this */ public function setDeltaSeconds($delta) { diff --git a/src/Headers.php b/src/Headers.php index 15c7f426c4..96153c2b83 100644 --- a/src/Headers.php +++ b/src/Headers.php @@ -46,7 +46,7 @@ class Headers implements Countable, Iterator * will be lazy loaded) * * @param string $string - * @return Headers + * @return static * @throws Exception\RuntimeException */ public static function fromString($string) @@ -109,8 +109,8 @@ public static function fromString($string) /** * Set an alternate implementation for the PluginClassLoader * - * @param \Zend\Loader\PluginClassLocator $pluginClassLoader - * @return Headers + * @param PluginClassLocator $pluginClassLoader + * @return $this */ public function setPluginClassLoader(PluginClassLocator $pluginClassLoader) { @@ -137,7 +137,7 @@ public function getPluginClassLoader() * Expects an array (or Traversable object) of type/value pairs. * * @param array|Traversable $headers - * @return Headers + * @return $this * @throws Exception\InvalidArgumentException */ public function addHeaders($headers) @@ -177,7 +177,7 @@ public function addHeaders($headers) * @throws Exception\InvalidArgumentException * @param string $headerFieldNameOrLine * @param string $fieldValue optional - * @return Headers + * @return $this */ public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null) { @@ -209,7 +209,7 @@ public function addHeaderLine($headerFieldNameOrLine, $fieldValue = null) * Add a Header to this container, for raw values @see addHeaderLine() and addHeaders() * * @param Header\HeaderInterface $header - * @return Headers + * @return $this */ public function addHeader(Header\HeaderInterface $header) { @@ -261,7 +261,7 @@ public function removeHeader(Header\HeaderInterface $header) * * Removes all headers from queue * - * @return Headers + * @return $this */ public function clearHeaders() { diff --git a/src/PhpEnvironment/RemoteAddress.php b/src/PhpEnvironment/RemoteAddress.php index 71adc3c7b1..65a001993a 100644 --- a/src/PhpEnvironment/RemoteAddress.php +++ b/src/PhpEnvironment/RemoteAddress.php @@ -45,7 +45,7 @@ class RemoteAddress * at session read, so this is the only way to switch setting. * * @param bool $useProxy Whether to check also proxied IP addresses. - * @return RemoteAddress + * @return $this */ public function setUseProxy($useProxy = true) { @@ -67,7 +67,7 @@ public function getUseProxy() * Set list of trusted proxy addresses * * @param array $trustedProxies - * @return RemoteAddress + * @return $this */ public function setTrustedProxies(array $trustedProxies) { @@ -79,7 +79,7 @@ public function setTrustedProxies(array $trustedProxies) * Set the header to introspect for proxy IPs * * @param string $header - * @return RemoteAddress + * @return $this */ public function setProxyHeader($header = 'X-Forwarded-For') { diff --git a/src/PhpEnvironment/Request.php b/src/PhpEnvironment/Request.php index 6aa733a122..98568a4478 100644 --- a/src/PhpEnvironment/Request.php +++ b/src/PhpEnvironment/Request.php @@ -107,7 +107,7 @@ public function getContent() * Instantiate and set cookies. * * @param $cookie - * @return Request + * @return $this */ public function setCookies($cookie) { @@ -119,7 +119,7 @@ public function setCookies($cookie) * Set the request URI. * * @param string $requestUri - * @return self + * @return $this */ public function setRequestUri($requestUri) { @@ -144,7 +144,7 @@ public function getRequestUri() * Set the base URL. * * @param string $baseUrl - * @return self + * @return $this */ public function setBaseUrl($baseUrl) { @@ -169,7 +169,7 @@ public function getBaseUrl() * Set the base path. * * @param string $basePath - * @return self + * @return $this */ public function setBasePath($basePath) { @@ -196,7 +196,7 @@ public function getBasePath() * (this is NOT the primary API for value setting, for that see getServer()) * * @param ParametersInterface $server - * @return Request + * @return $this */ public function setServer(ParametersInterface $server) { @@ -352,7 +352,7 @@ public function getServer($name = null, $default = null) * (this is NOT the primary API for value setting, for that see env()) * * @param ParametersInterface $env - * @return Request + * @return $this */ public function setEnv(ParametersInterface $env) { diff --git a/src/PhpEnvironment/Response.php b/src/PhpEnvironment/Response.php index 7952b2c9f9..0a926b20c1 100644 --- a/src/PhpEnvironment/Response.php +++ b/src/PhpEnvironment/Response.php @@ -76,7 +76,7 @@ public function contentSent() /** * Send HTTP headers * - * @return Response + * @return $this */ public function sendHeaders() { @@ -103,7 +103,7 @@ public function sendHeaders() /** * Send content * - * @return Response + * @return $this */ public function sendContent() { @@ -119,7 +119,7 @@ public function sendContent() /** * Send HTTP response * - * @return Response + * @return $this */ public function send() { diff --git a/src/Request.php b/src/Request.php index 9531fc5111..8b9cd6f277 100644 --- a/src/Request.php +++ b/src/Request.php @@ -71,7 +71,7 @@ class Request extends AbstractMessage implements RequestInterface * @param string $string * @param bool $allowCustomMethods * @throws Exception\InvalidArgumentException - * @return Request + * @return static */ public static function fromString($string, $allowCustomMethods = true) { @@ -166,7 +166,7 @@ public static function fromString($string, $allowCustomMethods = true) * Set the method for this request * * @param string $method - * @return Request + * @return $this * @throws Exception\InvalidArgumentException */ public function setMethod($method) @@ -194,7 +194,7 @@ public function getMethod() * * @throws Exception\InvalidArgumentException * @param string|HttpUri $uri - * @return Request + * @return $this */ public function setUri($uri) { @@ -248,8 +248,8 @@ public function getUriString() * Provide an alternate Parameter Container implementation for query parameters in this object, * (this is NOT the primary API for value setting, for that see getQuery()) * - * @param \Zend\Stdlib\ParametersInterface $query - * @return Request + * @param ParametersInterface $query + * @return $this */ public function setQuery(ParametersInterface $query) { @@ -260,9 +260,9 @@ public function setQuery(ParametersInterface $query) /** * Return the parameter container responsible for query parameters or a single query parameter * - * @param string|null $name Parameter name to retrieve, or null to get the whole container. - * @param mixed|null $default Default value to use when the parameter is missing. - * @return \Zend\Stdlib\ParametersInterface|mixed + * @param string|null $name Parameter name to retrieve, or null to get the whole container. + * @param mixed|null $default Default value to use when the parameter is missing. + * @return ParametersInterface|mixed */ public function getQuery($name = null, $default = null) { @@ -281,8 +281,8 @@ public function getQuery($name = null, $default = null) * Provide an alternate Parameter Container implementation for post parameters in this object, * (this is NOT the primary API for value setting, for that see getPost()) * - * @param \Zend\Stdlib\ParametersInterface $post - * @return Request + * @param ParametersInterface $post + * @return $this */ public function setPost(ParametersInterface $post) { @@ -293,9 +293,9 @@ public function setPost(ParametersInterface $post) /** * Return the parameter container responsible for post parameters or a single post parameter. * - * @param string|null $name Parameter name to retrieve, or null to get the whole container. - * @param mixed|null $default Default value to use when the parameter is missing. - * @return \Zend\Stdlib\ParametersInterface|mixed + * @param string|null $name Parameter name to retrieve, or null to get the whole container. + * @param mixed|null $default Default value to use when the parameter is missing. + * @return ParametersInterface|mixed */ public function getPost($name = null, $default = null) { @@ -326,7 +326,7 @@ public function getCookie() * (this is NOT the primary API for value setting, for that see getFiles()) * * @param ParametersInterface $files - * @return Request + * @return $this */ public function setFiles(ParametersInterface $files) { @@ -337,8 +337,8 @@ public function setFiles(ParametersInterface $files) /** * Return the parameter container responsible for file parameters or a single file. * - * @param string|null $name Parameter name to retrieve, or null to get the whole container. - * @param mixed|null $default Default value to use when the parameter is missing. + * @param string|null $name Parameter name to retrieve, or null to get the whole container. + * @param mixed|null $default Default value to use when the parameter is missing. * @return ParametersInterface|mixed */ public function getFiles($name = null, $default = null) @@ -358,8 +358,8 @@ public function getFiles($name = null, $default = null) * Return the header container responsible for headers or all headers of a certain name/type * * @see \Zend\Http\Headers::get() - * @param string|null $name Header name to retrieve, or null to get the whole container. - * @param mixed|null $default Default value to use when the requested header is missing. + * @param string|null $name Header name to retrieve, or null to get the whole container. + * @param mixed|null $default Default value to use when the requested header is missing. * @return \Zend\Http\Headers|bool|\Zend\Http\Header\HeaderInterface|\ArrayIterator */ public function getHeaders($name = null, $default = false) diff --git a/src/Response.php b/src/Response.php index 178639ddb5..a64dbf3d07 100644 --- a/src/Response.php +++ b/src/Response.php @@ -187,7 +187,7 @@ class Response extends AbstractMessage implements ResponseInterface * Populate object from string * * @param string $string - * @return self + * @return static * @throws Exception\InvalidArgumentException */ public static function fromString($string) @@ -285,7 +285,7 @@ public function getCookie() * * @param int $code * @throws Exception\InvalidArgumentException - * @return self + * @return $this */ public function setStatusCode($code) { @@ -320,7 +320,7 @@ public function getStatusCode() * * @param int $code * @throws Exception\InvalidArgumentException - * @return self + * @return $this */ public function setCustomStatusCode($code) { @@ -339,7 +339,7 @@ public function setCustomStatusCode($code) * Assign status code * * @param int $code - * @return self + * @return $this */ protected function saveStatusCode($code) { @@ -350,7 +350,7 @@ protected function saveStatusCode($code) /** * @param string $reasonPhrase - * @return self + * @return $this */ public function setReasonPhrase($reasonPhrase) { diff --git a/src/Response/Stream.php b/src/Response/Stream.php index dfeda1a7fe..371c0cc35e 100644 --- a/src/Response/Stream.php +++ b/src/Response/Stream.php @@ -87,7 +87,7 @@ public function getStream() * Set the response stream * * @param resource $stream - * @return Stream + * @return $this */ public function setStream($stream) { @@ -129,7 +129,7 @@ public function getStreamName() * Set file name associated with the stream * * @param string $streamName Name to set - * @return Stream + * @return $this */ public function setStreamName($streamName) { @@ -142,7 +142,7 @@ public function setStreamName($streamName) * * @param string $responseString * @param resource $stream - * @return Stream + * @return $this * @throws Exception\InvalidArgumentException * @throws Exception\OutOfRangeException */