PluginProbe
Plausible Analytics / trunk
Plausible Analytics vtrunk
2.6.1 2.6.0 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 All 52 releases
plausible-analytics / src / Client / lib / Lib / Psr / Http / Message / StreamFactoryInterface.php

StreamFactoryInterface.php in Plausible Analytics trunk, at src/Client/lib/Lib/Psr/Http/Message/StreamFactoryInterface.php

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Plausible\Analytics\WP\Client\Lib\Psr\Http\Message;
4
5 interface StreamFactoryInterface
6 {
7 /**
8 * Create a new stream from a string.
9 *
10 * The stream SHOULD be created with a temporary resource.
11 *
12 * @param string $content String content with which to populate the stream.
13 *
14 * @return StreamInterface
15 */
16 public function createStream(string $content = ''): StreamInterface;
17
18 /**
19 * Create a stream from an existing file.
20 *
21 * The file MUST be opened using the given mode, which may be any mode
22 * supported by the `fopen` function.
23 *
24 * The `$filename` MAY be any string supported by `fopen()`.
25 *
26 * @param string $filename Filename or stream URI to use as basis of stream.
27 * @param string $mode Mode with which to open the underlying filename/stream.
28 *
29 * @return StreamInterface
30 * @throws \RuntimeException If the file cannot be opened.
31 * @throws \InvalidArgumentException If the mode is invalid.
32 */
33 public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface;
34
35 /**
36 * Create a new stream from an existing resource.
37 *
38 * The stream MUST be readable and may be writable.
39 *
40 * @param resource $resource PHP resource to use as basis of stream.
41 *
42 * @return StreamInterface
43 */
44 public function createStreamFromResource($resource): StreamInterface;
45 }
46