1 | <?php |
||
14 | class ResourceWrapper { |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private static $__streams = []; |
||
20 | |||
21 | /** |
||
22 | * @var null|resource |
||
23 | */ |
||
24 | private $__stream; |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $__id = ''; |
||
29 | |||
30 | /** |
||
31 | * @var resource |
||
32 | */ |
||
33 | public $context; |
||
34 | |||
35 | /** |
||
36 | * Return an URI to open the stream, the actual stream will be stored in the |
||
37 | * class and removed by the destructor. |
||
38 | * |
||
39 | * @param resource $stream |
||
40 | * @param string $protocol |
||
41 | * @return string |
||
42 | */ |
||
43 | 5 | public static function createURI($stream, string $protocol = 'fluentdom-resource'): string { |
|
51 | |||
52 | /** |
||
53 | * Return an URI and a context to open the stream, the actual stream will be stored in the |
||
54 | * context. |
||
55 | * |
||
56 | * @param resource $stream |
||
57 | * @param string $protocol |
||
58 | * @return array |
||
59 | */ |
||
60 | 2 | public static function createContext($stream, string $protocol = 'fluentdom-resource'): array { |
|
66 | |||
67 | /** |
||
68 | * Register the stream wrapper for the given protocol, if it is not registered yet. |
||
69 | * |
||
70 | * @param string $protocol |
||
71 | */ |
||
72 | 7 | private static function register($protocol) { |
|
77 | |||
78 | /** |
||
79 | * @param string $path |
||
80 | * @param int $flags |
||
81 | * @return array |
||
82 | */ |
||
83 | 1 | public function url_stat(string $path , int $flags) { |
|
86 | |||
87 | /** |
||
88 | * @param string $path |
||
89 | * @param string $mode |
||
90 | * @param int $options |
||
91 | * @param string $opened_path |
||
92 | * @return bool |
||
93 | */ |
||
94 | 6 | public function stream_open($path, $mode, $options, &$opened_path): bool { |
|
111 | |||
112 | /** |
||
113 | * @param int $count |
||
114 | * @return bool|string |
||
115 | */ |
||
116 | 4 | public function stream_read(int $count) { |
|
119 | |||
120 | /** |
||
121 | * @param string $data |
||
122 | * @return bool|int |
||
123 | */ |
||
124 | 1 | public function stream_write(string $data) { |
|
127 | |||
128 | /** |
||
129 | * @return bool |
||
130 | */ |
||
131 | 4 | public function stream_eof(): bool { |
|
134 | |||
135 | /** |
||
136 | * @param int $offset |
||
137 | * @param int $whence |
||
138 | * @return int |
||
139 | */ |
||
140 | 1 | public function stream_seek(int $offset, int $whence): int { |
|
143 | |||
144 | 7 | public function __destruct() { |
|
149 | } |
||
150 | } |
||
151 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.