1 | <?php |
||
11 | final class MessageStream implements StreamInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var StreamInterface |
||
15 | */ |
||
16 | private $decoratedStream; |
||
17 | |||
18 | /** |
||
19 | * @param MessageInterface $message |
||
20 | */ |
||
21 | public function __construct(MessageInterface $message) |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | 56 | public function __toString(): string |
|
63 | |||
64 | public function close(): void |
||
68 | |||
69 | /** |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function detach() |
||
76 | |||
77 | /** |
||
78 | * @return int|null |
||
79 | */ |
||
80 | public function getSize(): ?int |
||
84 | |||
85 | /** |
||
86 | * @return int |
||
87 | * @throws \RuntimeException |
||
88 | */ |
||
89 | public function tell(): int |
||
93 | |||
94 | /** |
||
95 | * @return bool |
||
96 | */ |
||
97 | 2 | public function eof(): bool |
|
101 | |||
102 | /** |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function isSeekable(): bool |
||
109 | |||
110 | /** |
||
111 | * @param int $offset |
||
112 | * @param int $whence |
||
113 | * @return int |
||
114 | */ |
||
115 | public function seek(int $offset, int $whence = SEEK_SET): int |
||
119 | |||
120 | /** |
||
121 | * @return bool |
||
122 | */ |
||
123 | 2 | public function rewind(): bool |
|
127 | |||
128 | /** |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function isWritable(): bool |
||
135 | |||
136 | /** |
||
137 | * @param string $string |
||
138 | * @return int |
||
139 | */ |
||
140 | public function write($string): int |
||
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function isReadable(): bool |
||
152 | |||
153 | /** |
||
154 | * @param int $length |
||
155 | * @return string |
||
156 | */ |
||
157 | 2 | public function read(int $length): string |
|
161 | |||
162 | /** |
||
163 | * @return string |
||
164 | */ |
||
165 | public function getContents(): string |
||
169 | |||
170 | /** |
||
171 | * @param array $keys |
||
172 | * @return array |
||
173 | */ |
||
174 | public function getMetadata(array $keys = []): array |
||
178 | } |
||
179 |
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: