Total Complexity | 5 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class StreamWrapper |
||
12 | { |
||
13 | /** |
||
14 | * The name of the stream wrapper. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | const NAME = 'cerbero-json-objects'; |
||
19 | |||
20 | /** |
||
21 | * The stream context. |
||
22 | * |
||
23 | * @var resource |
||
24 | */ |
||
25 | public $context; |
||
26 | |||
27 | /** |
||
28 | * The stream. |
||
29 | * |
||
30 | * @var \Psr\Http\Message\StreamInterface |
||
31 | */ |
||
32 | protected $stream; |
||
33 | |||
34 | /** |
||
35 | * Open the stream |
||
36 | * |
||
37 | * @param string $path |
||
38 | * @param string $mode |
||
39 | * @param int $options |
||
40 | * @param mixed $opened_path |
||
41 | * @return bool |
||
42 | */ |
||
43 | 24 | public function stream_open(string $path, string $mode, int $options, &$opened_path) : bool |
|
1 ignored issue
–
show
|
|||
44 | { |
||
45 | 24 | $options = stream_context_get_options($this->context); |
|
46 | 24 | $stream = $options[static::NAME]['stream'] ?? null; |
|
47 | |||
48 | 24 | if (!$stream instanceof StreamInterface || !$stream->isReadable()) { |
|
49 | 9 | return false; |
|
50 | } |
||
51 | |||
52 | 15 | $this->stream = $stream; |
|
53 | |||
54 | 15 | return true; |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * Determine whether the pointer is at the end of the stream |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | 6 | public function stream_eof() : bool |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * Read from the stream |
||
69 | * |
||
70 | * @param int $count |
||
71 | * @return string |
||
72 | */ |
||
73 | 3 | public function stream_read(int $count) : string |
|
76 | } |
||
77 | } |
||
78 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.