diff options
author | Andrew Dolgov <[email protected]> | 2022-07-24 14:09:22 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-07-24 14:09:22 +0300 |
commit | 8cf421e1fcae66ee4a8ed6d8c007d26f501c0f1d (patch) | |
tree | babed96bab33455a00997f410da9b19c687a077a /plugins/af_readability/vendor/psr/http-factory/src | |
parent | 5006c754c42a09f5b88b258c2da4b9eff7508357 (diff) |
readability: depend on psr/http-factory
Diffstat (limited to 'plugins/af_readability/vendor/psr/http-factory/src')
6 files changed, 156 insertions, 0 deletions
diff --git a/plugins/af_readability/vendor/psr/http-factory/src/RequestFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/RequestFactoryInterface.php new file mode 100644 index 000000000..cb39a08bf --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/RequestFactoryInterface.php @@ -0,0 +1,18 @@ +<?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; +} diff --git a/plugins/af_readability/vendor/psr/http-factory/src/ResponseFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/ResponseFactoryInterface.php new file mode 100644 index 000000000..212562f00 --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/ResponseFactoryInterface.php @@ -0,0 +1,18 @@ +<?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; +} diff --git a/plugins/af_readability/vendor/psr/http-factory/src/ServerRequestFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/ServerRequestFactoryInterface.php new file mode 100644 index 000000000..9fe031a8f --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/ServerRequestFactoryInterface.php @@ -0,0 +1,24 @@ +<?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; +} diff --git a/plugins/af_readability/vendor/psr/http-factory/src/StreamFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/StreamFactoryInterface.php new file mode 100644 index 000000000..90e3240c4 --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/StreamFactoryInterface.php @@ -0,0 +1,45 @@ +<?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; +} diff --git a/plugins/af_readability/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php new file mode 100644 index 000000000..7db4e30af --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php @@ -0,0 +1,34 @@ +<?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; +} diff --git a/plugins/af_readability/vendor/psr/http-factory/src/UriFactoryInterface.php b/plugins/af_readability/vendor/psr/http-factory/src/UriFactoryInterface.php new file mode 100644 index 000000000..06df0b46a --- /dev/null +++ b/plugins/af_readability/vendor/psr/http-factory/src/UriFactoryInterface.php @@ -0,0 +1,17 @@ +<?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; +} |