From bdaae065bbe25a5b007980f030c4da12d621b54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 26 Aug 2021 16:38:12 +0800 Subject: [PATCH] delete http-message --- http-message/.gitignore | 34 ------ http-message/.phpstorm.meta.php | 17 --- http-message/composer.json | 24 ----- http-message/src/Message.php | 179 -------------------------------- http-message/src/Request.php | 113 -------------------- http-message/src/Uri.php | 162 ----------------------------- 6 files changed, 529 deletions(-) delete mode 100644 http-message/.gitignore delete mode 100644 http-message/.phpstorm.meta.php delete mode 100644 http-message/composer.json delete mode 100644 http-message/src/Message.php delete mode 100644 http-message/src/Request.php delete mode 100644 http-message/src/Uri.php diff --git a/http-message/.gitignore b/http-message/.gitignore deleted file mode 100644 index efca283f..00000000 --- a/http-message/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Yii template -assets/* -!assets/.gitignore -protected/runtime/* -!protected/runtime/.gitignore -protected/data/*.db -themes/classic/views/ - -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen - -composer.lock - -*.log -commands/result -config/setting.php -tests/ -vendor/ -runtime/ - -*.xml -*.lock - -oot -d - -composer.lock diff --git a/http-message/.phpstorm.meta.php b/http-message/.phpstorm.meta.php deleted file mode 100644 index 8b86fdba..00000000 --- a/http-message/.phpstorm.meta.php +++ /dev/null @@ -1,17 +0,0 @@ -=8.0", - "ext-json": "*", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "HttpMessage\\": "src/" - } - }, - "require-dev": { - "kwn/php-rdkafka-stubs": "^2.0" - } -} diff --git a/http-message/src/Message.php b/http-message/src/Message.php deleted file mode 100644 index 07c97669..00000000 --- a/http-message/src/Message.php +++ /dev/null @@ -1,179 +0,0 @@ - - */ - public array $headers = []; - - - /** - * @return string - */ - public function getProtocolVersion(): string - { - return $this->protocol; - } - - /** - * @param string $version - * @return $this - */ - public function withProtocolVersion($version): static - { - // TODO: Implement withProtocolVersion() method. - $new = clone $this; - $new->protocol = $version; - return $new; - } - - - /** - * @return array - */ - public function getHeaders(): array - { - // TODO: Implement getHeaders() method. - return $this->headers; - } - - - /** - * @param string $name - * @return bool - */ - public function hasHeader($name): bool - { - // TODO: Implement hasHeader() method. - return isset($this->headers[$name]); - } - - - /** - * @param string $name - * @return mixed - */ - public function getHeader($name): mixed - { - // TODO: Implement getHeader() method. - if (!$this->hasHeader($name)) { - return null; - } - return $this->headers[$name]; - } - - - /** - * @param string $name - * @return string|null - */ - public function getHeaderLine($name): ?string - { - // TODO: Implement getHeaderLine() method. - // TODO: Implement getHeader() method. - if (!$this->hasHeader($name)) { - return null; - } - return $this->headers[$name]; - } - - - /** - * @param string $name - * @param string|string[] $value - * @return Message - */ - public function withHeader($name, $value): static - { - // TODO: Implement withHeader() method. - $newInstance = clone $this; - $newInstance->headers[$name] = [$value]; - return $newInstance; - } - - - /** - * @param string $name - * @param string|string[] $value - * @return $this - */ - public function withAddedHeader($name, $value): static - { - // TODO: Implement withAddedHeader() method. - // TODO: Implement withHeader() method. - $newInstance = clone $this; - if (!isset($newInstance->headers)) { - $newInstance->headers[$name] = [$value]; - } else { - $newInstance->headers[$name][] = $value; - } - return $newInstance; - } - - - /** - * @param string $name - * @return $this - */ - public function withoutHeader($name): static - { - // TODO: Implement withoutHeader() method. - $newInstance = clone $this; - if (!isset($newInstance->headers)) { - return $newInstance; - } - unset($newInstance->headers[$name]); - return $newInstance; - } - - - /** - * @return mixed - */ - public function getBody(): mixed - { - // TODO: Implement getBody() method. - return $this->body; - } - - - /** - * @param StreamInterface $body - * @return $this - */ - public function withBody(StreamInterface $body): static - { - // TODO: Implement withBody() method. - $newInstance = clone $this; - $newInstance->body = $body; - return $newInstance; - } - -} diff --git a/http-message/src/Request.php b/http-message/src/Request.php deleted file mode 100644 index ea014a32..00000000 --- a/http-message/src/Request.php +++ /dev/null @@ -1,113 +0,0 @@ -requestTarget; - } - - - /** - * @param mixed $requestTarget - * @return Request - */ - public function withRequestTarget($requestTarget): static - { - // TODO: Implement withRequestTarget() method. - $newInstance = clone $this; - $newInstance->requestTarget = $requestTarget; - return $newInstance; - } - - /** - * @return string - */ - public function getMethod(): string - { - // TODO: Implement getMethod() method. - return $this->method; - } - - - /** - * @param string $method - * @return $this - */ - public function withMethod($method): static - { - // TODO: Implement withMethod() method. - $newInstance = clone $this; - $newInstance->method = $method; - return $newInstance; - } - - - /** - * @return string - */ - #[Pure] public function getUri(): string - { - // TODO: Implement getUri() method. - $uri = $this->uri->getPath(); - if (!empty($this->uri->getQuery())) { - $uri .= '?' . $this->uri->getQuery(); - } - return $uri; - } - - - /** - * @param UriInterface $uri - * @param false $preserveHost - * @return Request - */ - public function withUri(UriInterface $uri, $preserveHost = false): static - { - // TODO: Implement withUri() method. - $newInstance = clone $this; - $newInstance->uri = $uri; - return $newInstance; - } -} diff --git a/http-message/src/Uri.php b/http-message/src/Uri.php deleted file mode 100644 index c1a90e50..00000000 --- a/http-message/src/Uri.php +++ /dev/null @@ -1,162 +0,0 @@ -scheme; - } - - - /** - * @return string - */ - public function getAuthority(): string - { - // TODO: Implement getAuthority() method. - - return ''; - } - - public function getUserInfo() - { - // TODO: Implement getUserInfo() method. - } - - - /** - * @return string - */ - public function getHost(): string - { - // TODO: Implement getHost() method. - return $this->host; - } - - - /** - * @return int - */ - public function getPort(): int - { - // TODO: Implement getPort() method. - return $this->port; - } - - - /** - * @return string - */ - public function getPath(): string - { - // TODO: Implement getPath() method. - return $this->path; - } - - - /** - * @return string - */ - public function getQuery(): string - { - // TODO: Implement getQuery() method. - return $this->query; - } - - - /** - * @return string - */ - public function getFragment(): string - { - // TODO: Implement getFragment() method. - return $this->path; - } - - - /** - * @param string $scheme - * @return Uri|void - */ - public function withScheme($scheme): string - { - // TODO: Implement withScheme() method. - - } - - public function withUserInfo($user, $password = null) - { - // TODO: Implement withUserInfo() method. - } - - public function withHost($host) - { - // TODO: Implement withHost() method. - } - - public function withPort($port) - { - // TODO: Implement withPort() method. - } - - public function withPath($path) - { - // TODO: Implement withPath() method. - } - - public function withQuery($query) - { - // TODO: Implement withQuery() method. - } - - public function withFragment($fragment) - { - // TODO: Implement withFragment() method. - } - - public function __toString() - { - // TODO: Implement __toString() method. - } -}