| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 3 namespace WordPress\AiClientDependencies\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 * Create a stream from an existing file. 19 * 20 * The file MUST be opened using the given mode, which may be any mode 21 * supported by the `fopen` function. 22 * 23 * The `$filename` MAY be any string supported by `fopen()`. 24 * 25 * @param string $filename Filename or stream URI to use as basis of stream. 26 * @param string $mode Mode with which to open the underlying filename/stream. 27 * 28 * @return StreamInterface 29 * @throws \RuntimeException If the file cannot be opened. 30 * @throws \InvalidArgumentException If the mode is invalid. 31 */ 32 public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface; 33 /** 34 * Create a new stream from an existing resource. 35 * 36 * The stream MUST be readable and may be writable. 37 * 38 * @param resource $resource PHP resource to use as basis of stream. 39 * 40 * @return StreamInterface 41 */ 42 public function createStreamFromResource($resource): StreamInterface; 43 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sat Jun 13 09:38:55 2026 | Cross-referenced by PHPXref |