1 | <?php |
||
10 | class DataStream |
||
11 | { |
||
12 | /** |
||
13 | * @param mixed $input |
||
14 | * |
||
15 | * @throws StreamException |
||
16 | * |
||
17 | * @return resource |
||
18 | */ |
||
19 | public static function get($input) |
||
31 | |||
32 | /** |
||
33 | * @param resource $stream |
||
34 | * |
||
35 | * @return bool|null |
||
36 | */ |
||
37 | public static function close($stream): ?bool |
||
45 | |||
46 | /** |
||
47 | * @param mixed $input |
||
48 | * |
||
49 | * @throws StreamException |
||
50 | * |
||
51 | * @return resource |
||
52 | */ |
||
53 | protected static function resource($input) |
||
61 | |||
62 | /** |
||
63 | * @param string $input |
||
64 | * |
||
65 | * @throws StreamException |
||
66 | * |
||
67 | * @return resource |
||
68 | */ |
||
69 | protected static function string(string $input) |
||
83 | |||
84 | /** |
||
85 | * @param MessageInterface|StreamInterface $object |
||
86 | * |
||
87 | * @throws StreamException |
||
88 | * |
||
89 | * @return resource |
||
90 | */ |
||
91 | protected static function object($object) |
||
113 | |||
114 | /** |
||
115 | * Stream content from the given stream wrapper |
||
116 | * |
||
117 | * @param StreamInterface $stream |
||
118 | * |
||
119 | * @throws StreamException |
||
120 | * |
||
121 | * @return resource |
||
122 | */ |
||
123 | protected static function streamWrapper(StreamInterface $stream) |
||
142 | } |
||
143 |