updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -21,6 +21,7 @@ abstract class AbstractMessage extends Message
*/
const VERSION_10 = '1.0';
const VERSION_11 = '1.1';
const VERSION_2 = '2';
/**#@-*/
/**
@@ -34,16 +35,16 @@ abstract class AbstractMessage extends Message
protected $headers;
/**
* Set the HTTP version for this object, one of 1.0 or 1.1
* (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11)
* Set the HTTP version for this object, one of 1.0, 1.1 or 2
* (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)
*
* @param string $version (Must be 1.0 or 1.1)
* @return AbstractMessage
* @param string $version (Must be 1.0, 1.1 or 2)
* @return $this
* @throws Exception\InvalidArgumentException
*/
public function setVersion($version)
{
if ($version != self::VERSION_10 && $version != self::VERSION_11) {
if (! in_array($version, [self::VERSION_10, self::VERSION_11, self::VERSION_2])) {
throw new Exception\InvalidArgumentException(
'Not valid or not supported HTTP version: ' . $version
);
@@ -68,7 +69,7 @@ abstract class AbstractMessage extends Message
*
* @see getHeaders()
* @param Headers $headers
* @return AbstractMessage
* @return $this
*/
public function setHeaders(Headers $headers)
{