1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 10:34:23 +02:00

Dependencies update.

This commit is contained in:
camer0n
2025-04-22 17:42:15 -07:00
parent 35166cef68
commit a4d59dba0c
64 changed files with 3066 additions and 1870 deletions

View File

@@ -10,4 +10,7 @@ interface that describes a HTTP message. See the specification for more details.
Usage
-----
We'll certainly need some stuff in here.
Before reading the usage guide we recommend reading the PSR-7 interfaces method list:
* [`PSR-7 Interfaces Method List`](docs/PSR7-Interfaces.md)
* [`PSR-7 Usage Guide`](docs/PSR7-Usage.md)

View File

@@ -7,11 +7,11 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"require": {
"php": ">=5.3.0"
"php": "^7.2 || ^8.0"
},
"autoload": {
"psr-4": {
@@ -20,7 +20,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "2.0.x-dev"
}
}
}

View File

@@ -23,7 +23,7 @@ interface MessageInterface
*
* @return string HTTP protocol version.
*/
public function getProtocolVersion();
public function getProtocolVersion(): string;
/**
* Return an instance with the specified HTTP protocol version.
@@ -38,7 +38,7 @@ interface MessageInterface
* @param string $version HTTP protocol version
* @return static
*/
public function withProtocolVersion($version);
public function withProtocolVersion(string $version): MessageInterface;
/**
* Retrieves all message header values.
@@ -65,7 +65,7 @@ interface MessageInterface
* key MUST be a header name, and each value MUST be an array of strings
* for that header.
*/
public function getHeaders();
public function getHeaders(): array;
/**
* Checks if a header exists by the given case-insensitive name.
@@ -75,7 +75,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($name);
public function hasHeader(string $name): bool;
/**
* Retrieves a message header value by the given case-insensitive name.
@@ -91,7 +91,7 @@ interface MessageInterface
* header. If the header does not appear in the message, this method MUST
* return an empty array.
*/
public function getHeader($name);
public function getHeader(string $name): array;
/**
* Retrieves a comma-separated string of the values for a single header.
@@ -112,7 +112,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($name);
public function getHeaderLine(string $name): string;
/**
* Return an instance with the provided value replacing the specified header.
@@ -129,7 +129,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader($name, $value);
public function withHeader(string $name, $value): MessageInterface;
/**
* Return an instance with the specified header appended with the given value.
@@ -147,7 +147,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader($name, $value);
public function withAddedHeader(string $name, $value): MessageInterface;
/**
* Return an instance without the specified header.
@@ -161,14 +161,14 @@ interface MessageInterface
* @param string $name Case-insensitive header field name to remove.
* @return static
*/
public function withoutHeader($name);
public function withoutHeader(string $name): MessageInterface;
/**
* Gets the body of the message.
*
* @return StreamInterface Returns the body as a stream.
*/
public function getBody();
public function getBody(): StreamInterface;
/**
* Return an instance with the specified message body.
@@ -183,5 +183,5 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(StreamInterface $body);
public function withBody(StreamInterface $body): MessageInterface;
}

View File

@@ -39,7 +39,7 @@ interface RequestInterface extends MessageInterface
*
* @return string
*/
public function getRequestTarget();
public function getRequestTarget(): string;
/**
* Return an instance with the specific request-target.
@@ -55,17 +55,18 @@ interface RequestInterface extends MessageInterface
*
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
* request-target forms allowed in request messages)
* @param mixed $requestTarget
* @param string $requestTarget
* @return static
*/
public function withRequestTarget($requestTarget);
public function withRequestTarget(string $requestTarget): RequestInterface;
/**
* Retrieves the HTTP method of the request.
*
* @return string Returns the request method.
*/
public function getMethod();
public function getMethod(): string;
/**
* Return an instance with the provided HTTP method.
@@ -82,7 +83,7 @@ interface RequestInterface extends MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid HTTP methods.
*/
public function withMethod($method);
public function withMethod(string $method): RequestInterface;
/**
* Retrieves the URI instance.
@@ -93,7 +94,7 @@ interface RequestInterface extends MessageInterface
* @return UriInterface Returns a UriInterface instance
* representing the URI of the request.
*/
public function getUri();
public function getUri(): UriInterface;
/**
* Returns an instance with the provided URI.
@@ -125,5 +126,5 @@ interface RequestInterface extends MessageInterface
* @param bool $preserveHost Preserve the original state of the Host header.
* @return static
*/
public function withUri(UriInterface $uri, $preserveHost = false);
public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface;
}

View File

@@ -27,7 +27,7 @@ interface ResponseInterface extends MessageInterface
*
* @return int Status code.
*/
public function getStatusCode();
public function getStatusCode(): int;
/**
* Return an instance with the specified status code and, optionally, reason phrase.
@@ -49,7 +49,7 @@ interface ResponseInterface extends MessageInterface
* @return static
* @throws \InvalidArgumentException For invalid status code arguments.
*/
public function withStatus($code, $reasonPhrase = '');
public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface;
/**
* Gets the response reason phrase associated with the status code.
@@ -64,5 +64,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();
public function getReasonPhrase(): string;
}

View File

@@ -51,7 +51,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getServerParams();
public function getServerParams(): array;
/**
* Retrieve cookies.
@@ -63,7 +63,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getCookieParams();
public function getCookieParams(): array;
/**
* Return an instance with the specified cookies.
@@ -82,7 +82,7 @@ interface ServerRequestInterface extends RequestInterface
* @param array $cookies Array of key/value pairs representing cookies.
* @return static
*/
public function withCookieParams(array $cookies);
public function withCookieParams(array $cookies): ServerRequestInterface;
/**
* Retrieve query string arguments.
@@ -96,7 +96,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array
*/
public function getQueryParams();
public function getQueryParams(): array;
/**
* Return an instance with the specified query string arguments.
@@ -120,7 +120,7 @@ interface ServerRequestInterface extends RequestInterface
* $_GET.
* @return static
*/
public function withQueryParams(array $query);
public function withQueryParams(array $query): ServerRequestInterface;
/**
* Retrieve normalized file upload data.
@@ -134,7 +134,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();
public function getUploadedFiles(): array;
/**
* Create a new instance with the specified uploaded files.
@@ -147,7 +147,7 @@ interface ServerRequestInterface extends RequestInterface
* @return static
* @throws \InvalidArgumentException if an invalid structure is provided.
*/
public function withUploadedFiles(array $uploadedFiles);
public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface;
/**
* Retrieve any parameters provided in the request body.
@@ -194,7 +194,7 @@ interface ServerRequestInterface extends RequestInterface
* @throws \InvalidArgumentException if an unsupported argument type is
* provided.
*/
public function withParsedBody($data);
public function withParsedBody($data): ServerRequestInterface;
/**
* Retrieve attributes derived from the request.
@@ -207,7 +207,7 @@ interface ServerRequestInterface extends RequestInterface
*
* @return array Attributes derived from the request.
*/
public function getAttributes();
public function getAttributes(): array;
/**
* Retrieve a single derived request attribute.
@@ -224,7 +224,7 @@ interface ServerRequestInterface extends RequestInterface
* @param mixed $default Default value to return if the attribute does not exist.
* @return mixed
*/
public function getAttribute($name, $default = null);
public function getAttribute(string $name, $default = null);
/**
* Return an instance with the specified derived request attribute.
@@ -241,7 +241,7 @@ interface ServerRequestInterface extends RequestInterface
* @param mixed $value The value of the attribute.
* @return static
*/
public function withAttribute($name, $value);
public function withAttribute(string $name, $value): ServerRequestInterface;
/**
* Return an instance that removes the specified derived request attribute.
@@ -257,5 +257,5 @@ interface ServerRequestInterface extends RequestInterface
* @param string $name The attribute name.
* @return static
*/
public function withoutAttribute($name);
public function withoutAttribute(string $name): ServerRequestInterface;
}

View File

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

View File

@@ -28,7 +28,7 @@ interface UploadedFileInterface
* @throws \RuntimeException in cases when no stream is available or can be
* created.
*/
public function getStream();
public function getStream(): StreamInterface;
/**
* Move the uploaded file to a new location.
@@ -62,7 +62,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($targetPath);
public function moveTo(string $targetPath): void;
/**
* Retrieve the file size.
@@ -73,7 +73,7 @@ interface UploadedFileInterface
*
* @return int|null The file size in bytes or null if unknown.
*/
public function getSize();
public function getSize(): ?int;
/**
* Retrieve the error associated with the uploaded file.
@@ -89,7 +89,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();
public function getError(): int;
/**
* Retrieve the filename sent by the client.
@@ -104,7 +104,7 @@ interface UploadedFileInterface
* @return string|null The filename sent by the client or null if none
* was provided.
*/
public function getClientFilename();
public function getClientFilename(): ?string;
/**
* Retrieve the media type sent by the client.
@@ -119,5 +119,5 @@ interface UploadedFileInterface
* @return string|null The media type sent by the client or null if none
* was provided.
*/
public function getClientMediaType();
public function getClientMediaType(): ?string;
}

View File

@@ -1,4 +1,5 @@
<?php
namespace Psr\Http\Message;
/**
@@ -37,7 +38,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.1
* @return string The URI scheme.
*/
public function getScheme();
public function getScheme(): string;
/**
* Retrieve the authority component of the URI.
@@ -57,7 +58,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();
public function getAuthority(): string;
/**
* Retrieve the user information component of the URI.
@@ -74,7 +75,7 @@ interface UriInterface
*
* @return string The URI user information, in "username[:password]" format.
*/
public function getUserInfo();
public function getUserInfo(): string;
/**
* Retrieve the host component of the URI.
@@ -87,7 +88,7 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-3.2.2
* @return string The URI host.
*/
public function getHost();
public function getHost(): string;
/**
* Retrieve the port component of the URI.
@@ -104,7 +105,7 @@ interface UriInterface
*
* @return null|int The URI port.
*/
public function getPort();
public function getPort(): ?int;
/**
* Retrieve the path component of the URI.
@@ -131,7 +132,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.3
* @return string The URI path.
*/
public function getPath();
public function getPath(): string;
/**
* Retrieve the query string of the URI.
@@ -153,7 +154,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.4
* @return string The URI query string.
*/
public function getQuery();
public function getQuery(): string;
/**
* Retrieve the fragment component of the URI.
@@ -171,7 +172,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.5
* @return string The URI fragment.
*/
public function getFragment();
public function getFragment(): string;
/**
* Return an instance with the specified scheme.
@@ -188,7 +189,7 @@ interface UriInterface
* @return static A new instance with the specified scheme.
* @throws \InvalidArgumentException for invalid or unsupported schemes.
*/
public function withScheme($scheme);
public function withScheme(string $scheme): UriInterface;
/**
* Return an instance with the specified user information.
@@ -204,7 +205,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($user, $password = null);
public function withUserInfo(string $user, ?string $password = null): UriInterface;
/**
* Return an instance with the specified host.
@@ -218,7 +219,7 @@ interface UriInterface
* @return static A new instance with the specified host.
* @throws \InvalidArgumentException for invalid hostnames.
*/
public function withHost($host);
public function withHost(string $host): UriInterface;
/**
* Return an instance with the specified port.
@@ -237,7 +238,7 @@ interface UriInterface
* @return static A new instance with the specified port.
* @throws \InvalidArgumentException for invalid ports.
*/
public function withPort($port);
public function withPort(?int $port): UriInterface;
/**
* Return an instance with the specified path.
@@ -261,7 +262,7 @@ interface UriInterface
* @return static A new instance with the specified path.
* @throws \InvalidArgumentException for invalid paths.
*/
public function withPath($path);
public function withPath(string $path): UriInterface;
/**
* Return an instance with the specified query string.
@@ -278,7 +279,7 @@ interface UriInterface
* @return static A new instance with the specified query string.
* @throws \InvalidArgumentException for invalid query strings.
*/
public function withQuery($query);
public function withQuery(string $query): UriInterface;
/**
* Return an instance with the specified URI fragment.
@@ -294,7 +295,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($fragment);
public function withFragment(string $fragment): UriInterface;
/**
* Return the string representation as a URI reference.
@@ -319,5 +320,5 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-4.1
* @return string
*/
public function __toString();
public function __toString(): string;
}