@@ -61,10 +61,7 @@ public function __construct(RequestInterface $request, $socket, ?int $size = nul
61
61
$ this ->request = $ request ;
62
62
}
63
63
64
- /**
65
- * {@inheritdoc}
66
- */
67
- public function __toString ()
64
+ public function __toString (): string
68
65
{
69
66
try {
70
67
return $ this ->getContents ();
@@ -73,20 +70,14 @@ public function __toString()
73
70
}
74
71
}
75
72
76
- /**
77
- * {@inheritdoc}
78
- */
79
- public function close ()
73
+ public function close (): void
80
74
{
81
75
if ($ this ->isDetached || null === $ this ->socket ) {
82
76
throw new StreamException ('Stream is detached ' );
83
77
}
84
78
fclose ($ this ->socket );
85
79
}
86
80
87
- /**
88
- * {@inheritdoc}
89
- */
90
81
public function detach ()
91
82
{
92
83
if ($ this ->isDetached ) {
@@ -104,15 +95,12 @@ public function detach()
104
95
*
105
96
* @return int<0, max>|null
106
97
*/
107
- public function getSize ()
98
+ public function getSize (): ? int
108
99
{
109
100
return $ this ->size ;
110
101
}
111
102
112
- /**
113
- * {@inheritdoc}
114
- */
115
- public function tell ()
103
+ public function tell (): int
116
104
{
117
105
if ($ this ->isDetached || null === $ this ->socket ) {
118
106
throw new StreamException ('Stream is detached ' );
@@ -125,10 +113,7 @@ public function tell()
125
113
return $ tell ;
126
114
}
127
115
128
- /**
129
- * {@inheritdoc}
130
- */
131
- public function eof ()
116
+ public function eof (): bool
132
117
{
133
118
if ($ this ->isDetached || null === $ this ->socket ) {
134
119
throw new StreamException ('Stream is detached ' );
@@ -137,54 +122,32 @@ public function eof()
137
122
return feof ($ this ->socket );
138
123
}
139
124
140
- /**
141
- * {@inheritdoc}
142
- */
143
- public function isSeekable ()
125
+ public function isSeekable (): bool
144
126
{
145
127
return false ;
146
128
}
147
129
148
- /**
149
- * {@inheritdoc}
150
- *
151
- * @return void
152
- */
153
- public function seek ($ offset , $ whence = SEEK_SET )
130
+ public function seek ($ offset , $ whence = SEEK_SET ): void
154
131
{
155
132
throw new StreamException ('This stream is not seekable ' );
156
133
}
157
134
158
- /**
159
- * {@inheritdoc}
160
- *
161
- * @return void
162
- */
163
- public function rewind ()
135
+ public function rewind (): void
164
136
{
165
137
throw new StreamException ('This stream is not seekable ' );
166
138
}
167
139
168
- /**
169
- * {@inheritdoc}
170
- */
171
- public function isWritable ()
140
+ public function isWritable (): bool
172
141
{
173
142
return false ;
174
143
}
175
144
176
- /**
177
- * {@inheritdoc}
178
- */
179
- public function write ($ string )
145
+ public function write ($ string ): int
180
146
{
181
147
throw new StreamException ('This stream is not writable ' );
182
148
}
183
149
184
- /**
185
- * {@inheritdoc}
186
- */
187
- public function isReadable ()
150
+ public function isReadable (): bool
188
151
{
189
152
return true ;
190
153
}
@@ -194,7 +157,7 @@ public function isReadable()
194
157
*
195
158
* @param int<0, max> $length
196
159
*/
197
- public function read ($ length )
160
+ public function read ($ length ): string
198
161
{
199
162
if ($ this ->isDetached || null === $ this ->socket ) {
200
163
throw new StreamException ('Stream is detached ' );
@@ -232,10 +195,7 @@ public function read($length)
232
195
return $ read ;
233
196
}
234
197
235
- /**
236
- * {@inheritdoc}
237
- */
238
- public function getContents ()
198
+ public function getContents (): string
239
199
{
240
200
if ($ this ->isDetached || null === $ this ->socket ) {
241
201
throw new StreamException ('Stream is detached ' );
@@ -261,9 +221,6 @@ public function getContents()
261
221
return $ contents ;
262
222
}
263
223
264
- /**
265
- * {@inheritdoc}
266
- */
267
224
public function getMetadata ($ key = null )
268
225
{
269
226
if ($ this ->isDetached || null === $ this ->socket ) {
0 commit comments