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/StreamFactoryInterface.php | |
parent | 5006c754c42a09f5b88b258c2da4b9eff7508357 (diff) |
readability: depend on psr/http-factory
Diffstat (limited to 'plugins/af_readability/vendor/psr/http-factory/src/StreamFactoryInterface.php')
-rw-r--r-- | plugins/af_readability/vendor/psr/http-factory/src/StreamFactoryInterface.php | 45 |
1 files changed, 45 insertions, 0 deletions
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; +} |