京东云

This commit is contained in:
“wanyongkang”
2024-05-28 17:04:50 +08:00
parent f644932afb
commit f3c7432100
672 changed files with 209344 additions and 6593 deletions

View File

@@ -1,31 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file, in reverse chronological order by release.
## 1.0.3
Add `source` link in composer.json. No code changes.
## 1.0.2
Allow PSR-7 (psr/http-message) 2.0. No code changes.
## 1.0.1
Allow installation with PHP 8. No code changes.
## 1.0.0
First stable release. No changes since 0.3.0.
## 0.3.0
Added Interface suffix on exceptions
## 0.2.0
All exceptions are in `Psr\Http\Client` namespace
## 0.1.0
First release

View File

@@ -1,19 +0,0 @@
Copyright (c) 2017 PHP Framework Interoperability Group
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,12 +0,0 @@
HTTP Client
===========
This repository holds all the common code related to [PSR-18 (HTTP Client)][psr-url].
Note that this is not a HTTP Client implementation of its own. It is merely abstractions that describe the components of a HTTP Client.
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
[psr-url]: https://www.php-fig.org/psr/psr-18
[package-url]: https://packagist.org/packages/psr/http-client
[implementation-url]: https://packagist.org/providers/psr/http-client-implementation

View File

@@ -1,30 +0,0 @@
{
"name": "psr/http-client",
"description": "Common interface for HTTP clients",
"keywords": ["psr", "psr-18", "http", "http-client"],
"homepage": "https://github.com/php-fig/http-client",
"license": "MIT",
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"support": {
"source": "https://github.com/php-fig/http-client"
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0 || ^2.0"
},
"autoload": {
"psr-4": {
"Psr\\Http\\Client\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

View File

@@ -1,10 +0,0 @@
<?php
namespace Psr\Http\Client;
/**
* Every HTTP client related exception MUST implement this interface.
*/
interface ClientExceptionInterface extends \Throwable
{
}

View File

@@ -1,20 +0,0 @@
<?php
namespace Psr\Http\Client;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
interface ClientInterface
{
/**
* Sends a PSR-7 request and returns a PSR-7 response.
*
* @param RequestInterface $request
*
* @return ResponseInterface
*
* @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request.
*/
public function sendRequest(RequestInterface $request): ResponseInterface;
}

View File

@@ -1,24 +0,0 @@
<?php
namespace Psr\Http\Client;
use Psr\Http\Message\RequestInterface;
/**
* Thrown when the request cannot be completed because of network issues.
*
* There is no response object as this exception is thrown when no response has been received.
*
* Example: the target host name can not be resolved or the connection failed.
*/
interface NetworkExceptionInterface extends ClientExceptionInterface
{
/**
* Returns the request.
*
* The request object MAY be a different object from the one passed to ClientInterface::sendRequest()
*
* @return RequestInterface
*/
public function getRequest(): RequestInterface;
}

View File

@@ -1,24 +0,0 @@
<?php
namespace Psr\Http\Client;
use Psr\Http\Message\RequestInterface;
/**
* Exception for when a request failed.
*
* Examples:
* - Request is invalid (e.g. method is missing)
* - Runtime request errors (e.g. the body stream is not seekable)
*/
interface RequestExceptionInterface extends ClientExceptionInterface
{
/**
* Returns the request.
*
* The request object MAY be a different object from the one passed to ClientInterface::sendRequest()
*
* @return RequestInterface
*/
public function getRequest(): RequestInterface;
}

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 PHP-FIG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,12 +0,0 @@
HTTP Factories
==============
This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url].
Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory.
The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
[psr-url]: https://www.php-fig.org/psr/psr-17/
[package-url]: https://packagist.org/packages/psr/http-factory
[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation

View File

@@ -1,35 +0,0 @@
{
"name": "psr/http-factory",
"description": "Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"psr",
"psr-7",
"psr-17",
"http",
"factory",
"message",
"request",
"response"
],
"license": "MIT",
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0 || ^2.0"
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}

View File

@@ -1,18 +0,0 @@
<?php
namespace Psr\Http\Message;
interface RequestFactoryInterface
{
/**
* Create a new request.
*
* @param string $method The HTTP method associated with the request.
* @param UriInterface|string $uri The URI associated with the request. If
* the value is a string, the factory MUST create a UriInterface
* instance based on it.
*
* @return RequestInterface
*/
public function createRequest(string $method, $uri): RequestInterface;
}

View File

@@ -1,18 +0,0 @@
<?php
namespace Psr\Http\Message;
interface ResponseFactoryInterface
{
/**
* Create a new response.
*
* @param int $code HTTP status code; defaults to 200
* @param string $reasonPhrase Reason phrase to associate with status code
* in generated response; if none is provided implementations MAY use
* the defaults as suggested in the HTTP specification.
*
* @return ResponseInterface
*/
public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface;
}

View File

@@ -1,24 +0,0 @@
<?php
namespace Psr\Http\Message;
interface ServerRequestFactoryInterface
{
/**
* Create a new server request.
*
* Note that server-params are taken precisely as given - no parsing/processing
* of the given values is performed, and, in particular, no attempt is made to
* determine the HTTP method or URI, which must be provided explicitly.
*
* @param string $method The HTTP method associated with the request.
* @param UriInterface|string $uri The URI associated with the request. If
* the value is a string, the factory MUST create a UriInterface
* instance based on it.
* @param array $serverParams Array of SAPI parameters with which to seed
* the generated request instance.
*
* @return ServerRequestInterface
*/
public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface;
}

View File

@@ -1,45 +0,0 @@
<?php
namespace Psr\Http\Message;
interface StreamFactoryInterface
{
/**
* Create a new stream from a string.
*
* The stream SHOULD be created with a temporary resource.
*
* @param string $content String content with which to populate the stream.
*
* @return StreamInterface
*/
public function createStream(string $content = ''): StreamInterface;
/**
* Create a stream from an existing file.
*
* The file MUST be opened using the given mode, which may be any mode
* supported by the `fopen` function.
*
* The `$filename` MAY be any string supported by `fopen()`.
*
* @param string $filename Filename or stream URI to use as basis of stream.
* @param string $mode Mode with which to open the underlying filename/stream.
*
* @return StreamInterface
* @throws \RuntimeException If the file cannot be opened.
* @throws \InvalidArgumentException If the mode is invalid.
*/
public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface;
/**
* Create a new stream from an existing resource.
*
* The stream MUST be readable and may be writable.
*
* @param resource $resource PHP resource to use as basis of stream.
*
* @return StreamInterface
*/
public function createStreamFromResource($resource): StreamInterface;
}

View File

@@ -1,34 +0,0 @@
<?php
namespace Psr\Http\Message;
interface UploadedFileFactoryInterface
{
/**
* Create a new uploaded file.
*
* If a size is not provided it will be determined by checking the size of
* the file.
*
* @see http://php.net/manual/features.file-upload.post-method.php
* @see http://php.net/manual/features.file-upload.errors.php
*
* @param StreamInterface $stream Underlying stream representing the
* uploaded file content.
* @param int $size in bytes
* @param int $error PHP file upload error
* @param string $clientFilename Filename as provided by the client, if any.
* @param string $clientMediaType Media type as provided by the client, if any.
*
* @return UploadedFileInterface
*
* @throws \InvalidArgumentException If the file resource is not readable.
*/
public function createUploadedFile(
StreamInterface $stream,
int $size = null,
int $error = \UPLOAD_ERR_OK,
string $clientFilename = null,
string $clientMediaType = null
): UploadedFileInterface;
}

View File

@@ -1,17 +0,0 @@
<?php
namespace Psr\Http\Message;
interface UriFactoryInterface
{
/**
* Create a new URI.
*
* @param string $uri
*
* @return UriInterface
*
* @throws \InvalidArgumentException If the given URI cannot be parsed.
*/
public function createUri(string $uri = ''): UriInterface;
}

View File

@@ -7,7 +7,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
"homepage": "http://www.php-fig.org/"
}
],
"require": {
@@ -20,7 +20,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "1.1.x-dev"
}
}
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -23,7 +25,7 @@ interface MessageInterface
*
* @return string HTTP protocol version.
*/
public function getProtocolVersion(): string;
public function getProtocolVersion();
/**
* Return an instance with the specified HTTP protocol version.
@@ -38,7 +40,7 @@ interface MessageInterface
* @param string $version HTTP protocol version
* @return static
*/
public function withProtocolVersion(string $version): MessageInterface;
public function withProtocolVersion(string $version);
/**
* Retrieves all message header values.
@@ -65,7 +67,7 @@ interface MessageInterface
* key MUST be a header name, and each value MUST be an array of strings
* for that header.
*/
public function getHeaders(): array;
public function getHeaders();
/**
* Checks if a header exists by the given case-insensitive name.
@@ -75,7 +77,7 @@ interface MessageInterface
* name using a case-insensitive string comparison. Returns false if
* no matching header name is found in the message.
*/
public function hasHeader(string $name): bool;
public function hasHeader(string $name);
/**
* Retrieves a message header value by the given case-insensitive name.
@@ -91,7 +93,7 @@ interface MessageInterface
* header. If the header does not appear in the message, this method MUST
* return an empty array.
*/
public function getHeader(string $name): array;
public function getHeader(string $name);
/**
* Retrieves a comma-separated string of the values for a single header.
@@ -112,7 +114,7 @@ interface MessageInterface
* concatenated together using a comma. If the header does not appear in
* the message, this method MUST return an empty string.
*/
public function getHeaderLine(string $name): string;
public function getHeaderLine(string $name);
/**
* Return an instance with the provided value replacing the specified header.
@@ -129,7 +131,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader(string $name, $value): MessageInterface;
public function withHeader(string $name, $value);
/**
* Return an instance with the specified header appended with the given value.
@@ -147,7 +149,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader(string $name, $value): MessageInterface;
public function withAddedHeader(string $name, $value);
/**
* Return an instance without the specified header.
@@ -161,14 +163,14 @@ interface MessageInterface
* @param string $name Case-insensitive header field name to remove.
* @return static
*/
public function withoutHeader(string $name): MessageInterface;
public function withoutHeader(string $name);
/**
* Gets the body of the message.
*
* @return StreamInterface Returns the body as a stream.
*/
public function getBody(): StreamInterface;
public function getBody();
/**
* Return an instance with the specified message body.
@@ -183,5 +185,5 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(StreamInterface $body): MessageInterface;
public function withBody(StreamInterface $body);
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -39,7 +41,7 @@ interface RequestInterface extends MessageInterface
*
* @return string
*/
public function getRequestTarget(): string;
public function getRequestTarget();
/**
* Return an instance with the specific request-target.
@@ -58,15 +60,14 @@ interface RequestInterface extends MessageInterface
* @param string $requestTarget
* @return static
*/
public function withRequestTarget(string $requestTarget): RequestInterface;
public function withRequestTarget(string $requestTarget);
/**
* Retrieves the HTTP method of the request.
*
* @return string Returns the request method.
*/
public function getMethod(): string;
public function getMethod();
/**
* Return an instance with the provided HTTP method.
@@ -83,7 +84,7 @@ interface RequestInterface extends MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid HTTP methods.
*/
public function withMethod(string $method): RequestInterface;
public function withMethod(string $method);
/**
* Retrieves the URI instance.
@@ -94,7 +95,7 @@ interface RequestInterface extends MessageInterface
* @return UriInterface Returns a UriInterface instance
* representing the URI of the request.
*/
public function getUri(): UriInterface;
public function getUri();
/**
* Returns an instance with the provided URI.
@@ -126,5 +127,5 @@ interface RequestInterface extends MessageInterface
* @param bool $preserveHost Preserve the original state of the Host header.
* @return static
*/
public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface;
public function withUri(UriInterface $uri, bool $preserveHost = false);
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -27,7 +29,7 @@ interface ResponseInterface extends MessageInterface
*
* @return int Status code.
*/
public function getStatusCode(): int;
public function getStatusCode();
/**
* Return an instance with the specified status code and, optionally, reason phrase.
@@ -49,7 +51,7 @@ interface ResponseInterface extends MessageInterface
* @return static
* @throws \InvalidArgumentException For invalid status code arguments.
*/
public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface;
public function withStatus(int $code, string $reasonPhrase = '');
/**
* Gets the response reason phrase associated with the status code.
@@ -64,5 +66,5 @@ interface ResponseInterface extends MessageInterface
* @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
* @return string Reason phrase; must return an empty string if none present.
*/
public function getReasonPhrase(): string;
public function getReasonPhrase();
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -51,7 +53,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getServerParams(): array;
public function getServerParams();
/**
* Retrieve cookies.
@@ -63,7 +65,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getCookieParams(): array;
public function getCookieParams();
/**
* Return an instance with the specified cookies.
@@ -82,7 +84,7 @@ interface ServerRequestInterface extends RequestInterface
* @param array $cookies Array of key/value pairs representing cookies.
* @return static
*/
public function withCookieParams(array $cookies): ServerRequestInterface;
public function withCookieParams(array $cookies);
/**
* Retrieve query string arguments.
@@ -96,7 +98,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getQueryParams(): array;
public function getQueryParams();
/**
* Return an instance with the specified query string arguments.
@@ -120,7 +122,7 @@ interface ServerRequestInterface extends RequestInterface
* $_GET.
* @return static
*/
public function withQueryParams(array $query): ServerRequestInterface;
public function withQueryParams(array $query);
/**
* Retrieve normalized file upload data.
@@ -134,7 +136,7 @@ interface ServerRequestInterface extends RequestInterface
* @return array An array tree of UploadedFileInterface instances; an empty
* array MUST be returned if no data is present.
*/
public function getUploadedFiles(): array;
public function getUploadedFiles();
/**
* Create a new instance with the specified uploaded files.
@@ -147,7 +149,7 @@ interface ServerRequestInterface extends RequestInterface
* @return static
* @throws \InvalidArgumentException if an invalid structure is provided.
*/
public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface;
public function withUploadedFiles(array $uploadedFiles);
/**
* Retrieve any parameters provided in the request body.
@@ -194,7 +196,7 @@ interface ServerRequestInterface extends RequestInterface
* @throws \InvalidArgumentException if an unsupported argument type is
* provided.
*/
public function withParsedBody($data): ServerRequestInterface;
public function withParsedBody($data);
/**
* Retrieve attributes derived from the request.
@@ -207,7 +209,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array Attributes derived from the request.
*/
public function getAttributes(): array;
public function getAttributes();
/**
* Retrieve a single derived request attribute.
@@ -241,7 +243,7 @@ interface ServerRequestInterface extends RequestInterface
* @param mixed $value The value of the attribute.
* @return static
*/
public function withAttribute(string $name, $value): ServerRequestInterface;
public function withAttribute(string $name, $value);
/**
* Return an instance that removes the specified derived request attribute.
@@ -257,5 +259,5 @@ interface ServerRequestInterface extends RequestInterface
* @param string $name The attribute name.
* @return static
*/
public function withoutAttribute(string $name): ServerRequestInterface;
public function withoutAttribute(string $name);
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -25,14 +27,14 @@ interface StreamInterface
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
* @return string
*/
public function __toString(): string;
public function __toString();
/**
* Closes the stream and any underlying resources.
*
* @return void
*/
public function close(): void;
public function close();
/**
* Separates any underlying resources from the stream.
@@ -48,7 +50,7 @@ interface StreamInterface
*
* @return int|null Returns the size in bytes if known, or null if unknown.
*/
public function getSize(): ?int;
public function getSize();
/**
* Returns the current position of the file read/write pointer
@@ -56,21 +58,21 @@ interface StreamInterface
* @return int Position of the file pointer
* @throws \RuntimeException on error.
*/
public function tell(): int;
public function tell();
/**
* Returns true if the stream is at the end of the stream.
*
* @return bool
*/
public function eof(): bool;
public function eof();
/**
* Returns whether or not the stream is seekable.
*
* @return bool
*/
public function isSeekable(): bool;
public function isSeekable();
/**
* Seek to a position in the stream.
@@ -84,7 +86,7 @@ interface StreamInterface
* SEEK_END: Set position to end-of-stream plus offset.
* @throws \RuntimeException on failure.
*/
public function seek(int $offset, int $whence = SEEK_SET): void;
public function seek(int $offset, int $whence = SEEK_SET);
/**
* Seek to the beginning of the stream.
@@ -96,14 +98,14 @@ interface StreamInterface
* @link http://www.php.net/manual/en/function.fseek.php
* @throws \RuntimeException on failure.
*/
public function rewind(): void;
public function rewind();
/**
* Returns whether or not the stream is writable.
*
* @return bool
*/
public function isWritable(): bool;
public function isWritable();
/**
* Write data to the stream.
@@ -112,14 +114,14 @@ interface StreamInterface
* @return int Returns the number of bytes written to the stream.
* @throws \RuntimeException on failure.
*/
public function write(string $string): int;
public function write(string $string);
/**
* Returns whether or not the stream is readable.
*
* @return bool
*/
public function isReadable(): bool;
public function isReadable();
/**
* Read data from the stream.
@@ -131,7 +133,7 @@ interface StreamInterface
* if no bytes are available.
* @throws \RuntimeException if an error occurs.
*/
public function read(int $length): string;
public function read(int $length);
/**
* Returns the remaining contents in a string
@@ -140,7 +142,7 @@ interface StreamInterface
* @throws \RuntimeException if unable to read or an error occurs while
* reading.
*/
public function getContents(): string;
public function getContents();
/**
* Get stream metadata as an associative array or retrieve a specific key.

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -28,7 +30,7 @@ interface UploadedFileInterface
* @throws \RuntimeException in cases when no stream is available or can be
* created.
*/
public function getStream(): StreamInterface;
public function getStream();
/**
* Move the uploaded file to a new location.
@@ -62,7 +64,7 @@ interface UploadedFileInterface
* @throws \RuntimeException on any error during the move operation, or on
* the second or subsequent call to the method.
*/
public function moveTo(string $targetPath): void;
public function moveTo(string $targetPath);
/**
* Retrieve the file size.
@@ -73,7 +75,7 @@ interface UploadedFileInterface
*
* @return int|null The file size in bytes or null if unknown.
*/
public function getSize(): ?int;
public function getSize();
/**
* Retrieve the error associated with the uploaded file.
@@ -89,7 +91,7 @@ interface UploadedFileInterface
* @see http://php.net/manual/en/features.file-upload.errors.php
* @return int One of PHP's UPLOAD_ERR_XXX constants.
*/
public function getError(): int;
public function getError();
/**
* Retrieve the filename sent by the client.
@@ -104,7 +106,7 @@ interface UploadedFileInterface
* @return string|null The filename sent by the client or null if none
* was provided.
*/
public function getClientFilename(): ?string;
public function getClientFilename();
/**
* Retrieve the media type sent by the client.
@@ -119,5 +121,5 @@ interface UploadedFileInterface
* @return string|null The media type sent by the client or null if none
* was provided.
*/
public function getClientMediaType(): ?string;
public function getClientMediaType();
}

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -38,7 +40,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.1
* @return string The URI scheme.
*/
public function getScheme(): string;
public function getScheme();
/**
* Retrieve the authority component of the URI.
@@ -58,7 +60,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.2
* @return string The URI authority, in "[user-info@]host[:port]" format.
*/
public function getAuthority(): string;
public function getAuthority();
/**
* Retrieve the user information component of the URI.
@@ -75,7 +77,7 @@ interface UriInterface
*
* @return string The URI user information, in "username[:password]" format.
*/
public function getUserInfo(): string;
public function getUserInfo();
/**
* Retrieve the host component of the URI.
@@ -88,7 +90,7 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-3.2.2
* @return string The URI host.
*/
public function getHost(): string;
public function getHost();
/**
* Retrieve the port component of the URI.
@@ -105,7 +107,7 @@ interface UriInterface
*
* @return null|int The URI port.
*/
public function getPort(): ?int;
public function getPort();
/**
* Retrieve the path component of the URI.
@@ -132,7 +134,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.3
* @return string The URI path.
*/
public function getPath(): string;
public function getPath();
/**
* Retrieve the query string of the URI.
@@ -154,7 +156,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.4
* @return string The URI query string.
*/
public function getQuery(): string;
public function getQuery();
/**
* Retrieve the fragment component of the URI.
@@ -172,7 +174,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.5
* @return string The URI fragment.
*/
public function getFragment(): string;
public function getFragment();
/**
* Return an instance with the specified scheme.
@@ -189,7 +191,7 @@ interface UriInterface
* @return static A new instance with the specified scheme.
* @throws \InvalidArgumentException for invalid or unsupported schemes.
*/
public function withScheme(string $scheme): UriInterface;
public function withScheme(string $scheme);
/**
* Return an instance with the specified user information.
@@ -205,7 +207,7 @@ interface UriInterface
* @param null|string $password The password associated with $user.
* @return static A new instance with the specified user information.
*/
public function withUserInfo(string $user, ?string $password = null): UriInterface;
public function withUserInfo(string $user, ?string $password = null);
/**
* Return an instance with the specified host.
@@ -219,7 +221,7 @@ interface UriInterface
* @return static A new instance with the specified host.
* @throws \InvalidArgumentException for invalid hostnames.
*/
public function withHost(string $host): UriInterface;
public function withHost(string $host);
/**
* Return an instance with the specified port.
@@ -238,7 +240,7 @@ interface UriInterface
* @return static A new instance with the specified port.
* @throws \InvalidArgumentException for invalid ports.
*/
public function withPort(?int $port): UriInterface;
public function withPort(?int $port);
/**
* Return an instance with the specified path.
@@ -262,7 +264,7 @@ interface UriInterface
* @return static A new instance with the specified path.
* @throws \InvalidArgumentException for invalid paths.
*/
public function withPath(string $path): UriInterface;
public function withPath(string $path);
/**
* Return an instance with the specified query string.
@@ -279,7 +281,7 @@ interface UriInterface
* @return static A new instance with the specified query string.
* @throws \InvalidArgumentException for invalid query strings.
*/
public function withQuery(string $query): UriInterface;
public function withQuery(string $query);
/**
* Return an instance with the specified URI fragment.
@@ -295,7 +297,7 @@ interface UriInterface
* @param string $fragment The fragment to use with the new instance.
* @return static A new instance with the specified fragment.
*/
public function withFragment(string $fragment): UriInterface;
public function withFragment(string $fragment);
/**
* Return the string representation as a URI reference.
@@ -320,5 +322,5 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-4.1
* @return string
*/
public function __toString(): string;
public function __toString();
}