Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -3,7 +3,7 @@
* Zend Framework (http://framework.zend.com/)
*
* @see http://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2015 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
@ -11,6 +11,7 @@ namespace Zend\Diactoros;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
/**
* HTTP Request encapsulation
@ -21,10 +22,10 @@ use Psr\Http\Message\StreamInterface;
*/
class Request implements RequestInterface
{
use MessageTrait, RequestTrait;
use RequestTrait;
/**
* @param null|string $uri URI for the request, if any.
* @param null|string|UriInterface $uri URI for the request, if any.
* @param null|string $method HTTP method for the request, if any.
* @param string|resource|StreamInterface $body Message body, if any.
* @param array $headers Headers for the message, if any.
@ -42,7 +43,7 @@ class Request implements RequestInterface
{
$headers = $this->headers;
if (! $this->hasHeader('host')
&& ($this->uri && $this->uri->getHost())
&& $this->uri->getHost()
) {
$headers['Host'] = [$this->getHostFromUri()];
}
@ -57,7 +58,7 @@ class Request implements RequestInterface
{
if (! $this->hasHeader($header)) {
if (strtolower($header) === 'host'
&& ($this->uri && $this->uri->getHost())
&& $this->uri->getHost()
) {
return [$this->getHostFromUri()];
}
@ -66,9 +67,7 @@ class Request implements RequestInterface
}
$header = $this->headerNames[strtolower($header)];
$value = $this->headers[$header];
$value = is_array($value) ? $value : [$value];
return $value;
return $this->headers[$header];
}
}