for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
/**
* It's free open-source software released under the MIT License.
*
* @author Anatoly Nekhay <[email protected]>
* @copyright Copyright (c) 2018, Anatoly Nekhay
* @license https://github.com/sunrise-php/http-message/blob/master/LICENSE
* @link https://github.com/sunrise-php/http-message
*/
namespace Sunrise\Http\Message\Header;
* Import classes
use Psr\Http\Message\UriInterface;
use Sunrise\Http\Message\Exception\InvalidUriException;
use Sunrise\Http\Message\Header;
use Sunrise\Http\Message\Uri;
* @link https://tools.ietf.org/html/rfc2616#section-14.14
class ContentLocationHeader extends Header
{
* @var UriInterface
private UriInterface $uri;
* Constructor of the class
* @param mixed $uri
* @throws InvalidUriException
* If the URI isn't valid.
public function __construct($uri)
$uri = Uri::create($uri);
$this->uri = $uri;
}
* {@inheritdoc}
public function getFieldName(): string
return 'Content-Location';
public function getFieldValue(): string
return $this->uri->__toString();