1 | <?php |
||
11 | final class MessageStream implements StreamInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var StreamInterface |
||
15 | */ |
||
16 | private $decoratedStream; |
||
17 | |||
18 | /** |
||
19 | * MessageStream constructor. |
||
20 | * @param MessageInterface $message |
||
21 | */ |
||
22 | 35 | public function __construct(MessageInterface $message) |
|
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | 34 | public function __toString(): string |
|
64 | |||
65 | /** |
||
66 | * |
||
67 | */ |
||
68 | public function close(): void |
||
72 | |||
73 | /** |
||
74 | * @return mixed |
||
75 | */ |
||
76 | public function detach() |
||
80 | |||
81 | /** |
||
82 | * @return int|null |
||
83 | */ |
||
84 | public function getSize(): ?int |
||
88 | |||
89 | /** |
||
90 | * @return int |
||
91 | * @throws \RuntimeException |
||
92 | */ |
||
93 | public function tell(): int |
||
97 | |||
98 | /** |
||
99 | * @return bool |
||
100 | */ |
||
101 | 1 | public function eof(): bool |
|
105 | |||
106 | /** |
||
107 | * @return bool |
||
108 | */ |
||
109 | public function isSeekable(): bool |
||
113 | |||
114 | /** |
||
115 | * @param int $offset |
||
116 | * @param int $whence |
||
117 | * @return int |
||
118 | */ |
||
119 | public function seek(int $offset, int $whence = SEEK_SET): int |
||
123 | |||
124 | /** |
||
125 | * @return bool |
||
126 | */ |
||
127 | 1 | public function rewind(): bool |
|
128 | { |
||
129 | 1 | return $this->decoratedStream->rewind(); |
|
130 | } |
||
131 | |||
132 | /** |
||
133 | * @return bool |
||
134 | */ |
||
135 | public function isWritable(): bool |
||
139 | |||
140 | /** |
||
141 | * @param $string |
||
142 | * @return int |
||
143 | */ |
||
144 | public function write($string): int |
||
148 | |||
149 | /** |
||
150 | * @return bool |
||
151 | */ |
||
152 | public function isReadable(): bool |
||
156 | |||
157 | /** |
||
158 | * @param int $length |
||
159 | * @return string |
||
160 | */ |
||
161 | 1 | public function read(int $length): string |
|
165 | |||
166 | /** |
||
167 | * @return string |
||
168 | */ |
||
169 | public function getContents(): string |
||
173 | |||
174 | /** |
||
175 | * @param array $keys |
||
176 | * @return array |
||
177 | */ |
||
178 | public function getMetadata(array $keys = []): array |
||
182 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: