diff --git a/http-server/Constrict/ServerRequest.php b/http-server/Constrict/ServerRequest.php new file mode 100644 index 00000000..033034e1 --- /dev/null +++ b/http-server/Constrict/ServerRequest.php @@ -0,0 +1,127 @@ +cookies; + } + + + /** + * @param array $cookies + * @return $this|ServerRequest + */ + public function withCookieParams(array $cookies): ServerRequestInterface + { + $this->cookies = $cookies; + return $this; + } + + + /** + * @return array + */ + public function getQueryParams(): array + { + return []; + } + + public function withQueryParams(array $query): ServerRequestInterface + { + return $this; + } + + public function getUploadedFiles() + { + // TODO: Implement getUploadedFiles() method. + } + + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface + { + return $this; + } + + + /** + * @return array|object|null + */ + public function getParsedBody(): object|array|null + { + return null; + } + + + /** + * @param array|object|null $data + * @return ServerRequestInterface + */ + public function withParsedBody($data): ServerRequestInterface + { + return $this; + } + + + /** + * @return array + */ + public function getAttributes(): array + { + return []; + } + + + /** + * @param string $name + * @param null $default + * @return mixed|null + */ + public function getAttribute($name, $default = null) + { + return $default; + } + + + /** + * @param string $name + * @param mixed $value + * @return ServerRequestInterface + */ + public function withAttribute($name, $value): ServerRequestInterface + { + return $this; + } + + + /** + * @param string $name + * @return ServerRequestInterface + */ + public function withoutAttribute($name): ServerRequestInterface + { + // TODO: Implement withoutAttribute() method. + return $this; + } +} diff --git a/http-server/Constrict/TRequest.php b/http-server/Constrict/TRequest.php new file mode 100644 index 00000000..b78fc48a --- /dev/null +++ b/http-server/Constrict/TRequest.php @@ -0,0 +1,82 @@ +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; + } +}