Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit e107186

Browse files
committed
Merge branch 'qa/205'
Close #205
2 parents a7bc28c + 18e75b1 commit e107186

30 files changed

+116
-123
lines changed

src/AbstractMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class AbstractMessage extends Message
3939
* (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)
4040
*
4141
* @param string $version (Must be 1.0, 1.1 or 2)
42-
* @return AbstractMessage
42+
* @return $this
4343
* @throws Exception\InvalidArgumentException
4444
*/
4545
public function setVersion($version)
@@ -69,7 +69,7 @@ public function getVersion()
6969
*
7070
* @see getHeaders()
7171
* @param Headers $headers
72-
* @return AbstractMessage
72+
* @return $this
7373
*/
7474
public function setHeaders(Headers $headers)
7575
{

src/Client.php

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function __construct($uri = null, $options = null)
152152
* Set configuration parameters for this HTTP client
153153
*
154154
* @param array|Traversable $options
155-
* @return Client
155+
* @return $this
156156
* @throws Client\Exception\InvalidArgumentException
157157
*/
158158
public function setOptions($options = [])
@@ -184,7 +184,7 @@ public function setOptions($options = [])
184184
* separated from ->request() to preserve logic and readability
185185
*
186186
* @param Client\Adapter\AdapterInterface|string $adapter
187-
* @return Client
187+
* @return $this
188188
* @throws Client\Exception\InvalidArgumentException
189189
*/
190190
public function setAdapter($adapter)
@@ -212,7 +212,7 @@ public function setAdapter($adapter)
212212
/**
213213
* Load the connection adapter
214214
*
215-
* @return Client\Adapter\AdapterInterface $adapter
215+
* @return Client\Adapter\AdapterInterface
216216
*/
217217
public function getAdapter()
218218
{
@@ -227,7 +227,7 @@ public function getAdapter()
227227
* Set request
228228
*
229229
* @param Request $request
230-
* @return Client
230+
* @return $this
231231
*/
232232
public function setRequest(Request $request)
233233
{
@@ -253,7 +253,7 @@ public function getRequest()
253253
* Set response
254254
*
255255
* @param Response $response
256-
* @return Client
256+
* @return $this
257257
*/
258258
public function setResponse(Response $response)
259259
{
@@ -308,7 +308,7 @@ public function getRedirectionsCount()
308308
* Set Uri (to the request)
309309
*
310310
* @param string|Http $uri
311-
* @return Client
311+
* @return $this
312312
*/
313313
public function setUri($uri)
314314
{
@@ -356,7 +356,7 @@ public function getUri()
356356
* Set the HTTP method (to the request)
357357
*
358358
* @param string $method
359-
* @return Client
359+
* @return $this
360360
*/
361361
public function setMethod($method)
362362
{
@@ -395,7 +395,7 @@ public function getMethod()
395395
* Set the query string argument separator
396396
*
397397
* @param string $argSeparator
398-
* @return Client
398+
* @return $this
399399
*/
400400
public function setArgSeparator($argSeparator)
401401
{
@@ -423,7 +423,7 @@ public function getArgSeparator()
423423
*
424424
* @param string $encType
425425
* @param string $boundary
426-
* @return Client
426+
* @return $this
427427
*/
428428
public function setEncType($encType, $boundary = null)
429429
{
@@ -454,7 +454,7 @@ public function getEncType()
454454
* Set raw body (for advanced use cases)
455455
*
456456
* @param string $body
457-
* @return Client
457+
* @return $this
458458
*/
459459
public function setRawBody($body)
460460
{
@@ -466,7 +466,7 @@ public function setRawBody($body)
466466
* Set the POST parameters
467467
*
468468
* @param array $post
469-
* @return Client
469+
* @return $this
470470
*/
471471
public function setParameterPost(array $post)
472472
{
@@ -478,7 +478,7 @@ public function setParameterPost(array $post)
478478
* Set the GET parameters
479479
*
480480
* @param array $query
481-
* @return Client
481+
* @return $this
482482
*/
483483
public function setParameterGet(array $query)
484484
{
@@ -491,7 +491,7 @@ public function setParameterGet(array $query)
491491
*
492492
* @param bool $clearCookies Also clear all valid cookies? (defaults to false)
493493
* @param bool $clearAuth Also clear http authentication? (defaults to true)
494-
* @return Client
494+
* @return $this
495495
*/
496496
public function resetParameters($clearCookies = false /*, $clearAuth = true */)
497497
{
@@ -559,7 +559,7 @@ protected function getCookieId($cookie)
559559
* @param string $maxAge
560560
* @param string $version
561561
* @throws Exception\InvalidArgumentException
562-
* @return Client
562+
* @return $this
563563
*/
564564
public function addCookie(
565565
$cookie,
@@ -606,7 +606,7 @@ public function addCookie(
606606
*
607607
* @param array|SetCookie[] $cookies Cookies as name=>value pairs or instances of SetCookie.
608608
* @throws Exception\InvalidArgumentException
609-
* @return Client
609+
* @return $this
610610
*/
611611
public function setCookies($cookies)
612612
{
@@ -638,7 +638,7 @@ public function clearCookies()
638638
*
639639
* @param Headers|array $headers
640640
* @throws Exception\InvalidArgumentException
641-
* @return Client
641+
* @return $this
642642
*/
643643
public function setHeaders($headers)
644644
{
@@ -693,7 +693,7 @@ public function getHeader($name)
693693
* Set streaming for received data
694694
*
695695
* @param string|bool $streamfile Stream file, true for temp file, false/null for no streaming
696-
* @return \Zend\Http\Client
696+
* @return $this
697697
*/
698698
public function setStream($streamfile = true)
699699
{
@@ -717,8 +717,8 @@ public function getStream()
717717
/**
718718
* Create temporary stream
719719
*
720-
* @throws Exception\RuntimeException
721720
* @return resource
721+
* @throws Exception\RuntimeException
722722
*/
723723
protected function openTempStream()
724724
{
@@ -753,7 +753,7 @@ protected function openTempStream()
753753
* @param string $password
754754
* @param string $type
755755
* @throws Exception\InvalidArgumentException
756-
* @return Client
756+
* @return $this
757757
*/
758758
public function setAuth($user, $password, $type = self::AUTH_BASIC)
759759
{
@@ -865,7 +865,7 @@ public function dispatch(Stdlib\RequestInterface $request, Stdlib\ResponseInterf
865865
/**
866866
* Send HTTP request
867867
*
868-
* @param Request $request
868+
* @param Request|null $request
869869
* @return Response
870870
* @throws Exception\RuntimeException
871871
* @throws Client\Exception\RuntimeException
@@ -1043,7 +1043,7 @@ public function send(Request $request = null)
10431043
/**
10441044
* Fully reset the HTTP client (auth, cookies, request, response, etc.)
10451045
*
1046-
* @return Client
1046+
* @return $this
10471047
*/
10481048
public function reset()
10491049
{
@@ -1071,7 +1071,7 @@ public function reset()
10711071
* @param string $data Data to send (if null, $filename is read and sent)
10721072
* @param string $ctype Content type to use (if $data is set and $ctype is
10731073
* null, will be application/octet-stream)
1074-
* @return Client
1074+
* @return $this
10751075
* @throws Exception\RuntimeException
10761076
*/
10771077
public function setFileUpload($filename, $formname, $data = null, $ctype = null)
@@ -1154,8 +1154,8 @@ protected function prepareCookies($domain, $path, $secure)
11541154
*
11551155
* @param resource|string $body
11561156
* @param Http $uri
1157-
* @throws Exception\RuntimeException
11581157
* @return array
1158+
* @throws Exception\RuntimeException
11591159
*/
11601160
protected function prepareHeaders($body, $uri)
11611161
{
@@ -1499,7 +1499,5 @@ public static function encodeAuthHeader($user, $password, $type = self::AUTH_BAS
14991499
$type
15001500
));
15011501
}
1502-
1503-
return;
15041502
}
15051503
}

src/Client/Adapter/Curl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct()
101101
* Set the configuration array for the adapter
102102
*
103103
* @param array|Traversable $options
104-
* @return Curl
104+
* @return $this
105105
* @throws AdapterException\InvalidArgumentException
106106
*/
107107
public function setOptions($options = [])
@@ -168,7 +168,7 @@ public function getConfig()
168168
*
169169
* @param string|int $option
170170
* @param mixed $value
171-
* @return Curl
171+
* @return $this
172172
*/
173173
public function setCurlOption($option, $value)
174174
{
@@ -553,7 +553,7 @@ public function getHandle()
553553
* Set output stream for the response
554554
*
555555
* @param resource $stream
556-
* @return Curl
556+
* @return $this
557557
*/
558558
public function setOutputStream($stream)
559559
{

src/Client/Adapter/Socket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function getConfig()
143143
*
144144
* @param mixed $context Stream context or array of context options
145145
* @throws Exception\InvalidArgumentException
146-
* @return Socket
146+
* @return $this
147147
*/
148148
public function setStreamContext($context)
149149
{

src/Cookies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ protected function _matchPath($domains, $path)
338338
*
339339
* @param Response $response HTTP Response object
340340
* @param Uri\Uri|string $refUri The requested URI
341-
* @return Cookies
341+
* @return static
342342
* @todo Add the $uri functionality.
343343
*/
344344
public static function fromResponse(Response $response, $refUri)
@@ -361,7 +361,7 @@ public function isEmpty()
361361
/**
362362
* Empties the cookieJar of any cookie
363363
*
364-
* @return Cookies
364+
* @return $this
365365
*/
366366
public function reset()
367367
{

src/Header/AbstractAccept.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function parseHeaderLine($headerLine)
7777
* Factory method: parse Accept header string
7878
*
7979
* @param string $headerLine
80-
* @return Accept
80+
* @return static
8181
*/
8282
public static function fromString($headerLine)
8383
{
@@ -242,7 +242,7 @@ function ($v) {
242242
* @param int|float $priority
243243
* @param array (optional) $params
244244
* @throws Exception\InvalidArgumentException
245-
* @return Accept
245+
* @return $this
246246
*/
247247
protected function addType($type, $priority = 1, array $params = [])
248248
{

src/Header/AbstractDate.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class AbstractDate implements HeaderInterface
6565
* Create date-based header from string
6666
*
6767
* @param string $headerLine
68-
* @return AbstractDate
68+
* @return static
6969
* @throws Exception\InvalidArgumentException
7070
*/
7171
public static function fromString($headerLine)
@@ -90,9 +90,7 @@ public static function fromString($headerLine)
9090
* Create date-based header from strtotime()-compatible string
9191
*
9292
* @param int|string $time
93-
*
94-
* @return self
95-
*
93+
* @return static
9694
* @throws Exception\InvalidArgumentException
9795
*/
9896
public static function fromTimeString($time)
@@ -104,9 +102,7 @@ public static function fromTimeString($time)
104102
* Create date-based header from Unix timestamp
105103
*
106104
* @param int $time
107-
*
108-
* @return self
109-
*
105+
* @return static
110106
* @throws Exception\InvalidArgumentException
111107
*/
112108
public static function fromTimestamp($time)
@@ -156,7 +152,7 @@ public static function getDateFormat()
156152
* Set the date for this header, this can be a string or an instance of \DateTime
157153
*
158154
* @param string|DateTime $date
159-
* @return AbstractDate
155+
* @return $this
160156
* @throws Exception\InvalidArgumentException
161157
*/
162158
public function setDate($date)

src/Header/AbstractLocation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class AbstractLocation implements HeaderInterface
3535
* Create location-based header from string
3636
*
3737
* @param string $headerLine
38-
* @return AbstractLocation
38+
* @return static
3939
* @throws Exception\InvalidArgumentException
4040
*/
4141
public static function fromString($headerLine)
@@ -62,7 +62,7 @@ public static function fromString($headerLine)
6262
* Set the URI/URL for this header, this can be a string or an instance of Zend\Uri\Http
6363
*
6464
* @param string|UriInterface $uri
65-
* @return AbstractLocation
65+
* @return $this
6666
* @throws Exception\InvalidArgumentException
6767
*/
6868
public function setUri($uri)

src/Header/Accept.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function toString()
4747
* @param string $type
4848
* @param int|float $priority
4949
* @param array $params
50-
* @return Accept
50+
* @return $this
5151
*/
5252
public function addMediaType($type, $priority = 1, array $params = [])
5353
{

src/Header/Accept/FieldValuePart/AbstractFieldValuePart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct($internalValues)
3838
* Set a Field Value Part this Field Value Part matched against.
3939
*
4040
* @param AbstractFieldValuePart $matchedAgainst
41-
* @return AbstractFieldValuePart provides fluent interface
41+
* @return $this
4242
*/
4343
public function setMatchedAgainst(AbstractFieldValuePart $matchedAgainst)
4444
{

0 commit comments

Comments
 (0)