Files
kiri-core/http-server/Constrict/TRequest.php
T
2021-09-09 19:23:21 +08:00

83 lines
1.3 KiB
PHP

<?php
namespace Server\Constrict;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\UriInterface;
use Server\Message\Message;
class TRequest implements RequestInterface
{
use Message;
private UriInterface $uri;
private string $method;
/**
* @return string
*/
public function getRequestTarget(): string
{
throw new \BadMethodCallException('Not Accomplish Method.');
}
/**
* @param mixed $requestTarget
* @return static
*/
public function withRequestTarget($requestTarget): static
{
throw new \BadMethodCallException('Not Accomplish Method.');
}
/**
* @return string
*/
public function getMethod(): string
{
// TODO: Implement getMethod() method.
return $this->method;
}
/**
* @param string $method
* @return RequestInterface
*/
public function withMethod($method): RequestInterface
{
// TODO: Implement withMethod() method.
$this->method = $method;
return $this;
}
/**
* @return UriInterface
*/
public function getUri(): UriInterface
{
// TODO: Implement getUri() method.
return $this->uri;
}
/**
* @param UriInterface $uri
* @param false $preserveHost
* @return $this|TRequest
*/
public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
$this->uri = $uri;
return $this;
}
}