@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | if (!is_resource($resource)) |
37 | 37 | { |
38 | - throw new InvalidArgumentException('First parameter must be a valid resource.'); |
|
38 | + throw new InvalidArgumentException('First parameter must be a valid resource.'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->resource = $resource; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | throw new WriteException('Cannot seek on stream.'); |
163 | 163 | } |
164 | 164 | |
165 | - $this->emit('seek', [ $this, $pointer ]); |
|
165 | + $this->emit('seek', [$this, $pointer]); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | $this->readable = false; |
198 | 198 | $this->writable = false; |
199 | 199 | |
200 | - $this->emit('close', [ $this ]); |
|
200 | + $this->emit('close', [$this]); |
|
201 | 201 | $this->handleClose(); |
202 | - $this->emit('done', [ $this ]); |
|
202 | + $this->emit('done', [$this]); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | protected function throwAndEmitException($ex) |
213 | 213 | { |
214 | - $this->emit('error', [ $this, $ex ]); |
|
214 | + $this->emit('error', [$this, $ex]); |
|
215 | 215 | throw $ex; |
216 | 216 | } |
217 | 217 |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | $this->writeEnd(); |
169 | 169 | } |
170 | 170 | |
171 | - $this->emit('close', [ $this ]); |
|
171 | + $this->emit('close', [$this]); |
|
172 | 172 | $this->handleClose(); |
173 | - $this->emit('done', [ $this ]); |
|
173 | + $this->emit('done', [$this]); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | if ($sent === false) |
187 | 187 | { |
188 | - $this->emit('error', [ $this, new WriteException('Error occurred while writing to the stream resource.') ]); |
|
188 | + $this->emit('error', [$this, new WriteException('Error occurred while writing to the stream resource.')]); |
|
189 | 189 | return; |
190 | 190 | } |
191 | 191 | |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | |
196 | 196 | if ($lenAfter > 0 && $lenBefore >= $this->bufferSize && $lenAfter < $this->bufferSize) |
197 | 197 | { |
198 | - $this->emit('drain', [ $this ]); |
|
198 | + $this->emit('drain', [$this]); |
|
199 | 199 | } |
200 | 200 | else if ($lenAfter === 0) |
201 | 201 | { |
202 | 202 | $this->loop->removeWriteStream($this->resource); |
203 | 203 | $this->writing = false; |
204 | - $this->emit('drain', [ $this ]); |
|
205 | - $this->emit('finish', [ $this ]); |
|
204 | + $this->emit('drain', [$this]); |
|
205 | + $this->emit('finish', [$this]); |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | protected function getHandleWriteFunction() |
227 | 227 | { |
228 | - return [ $this, 'handleWrite' ]; |
|
228 | + return [$this, 'handleWrite']; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -157,19 +157,19 @@ discard block |
||
157 | 157 | |
158 | 158 | if ($ret === false) |
159 | 159 | { |
160 | - $this->emit('error', [ $this, new ReadException('Error occurred while reading from the stream resource.') ]); |
|
160 | + $this->emit('error', [$this, new ReadException('Error occurred while reading from the stream resource.')]); |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
164 | 164 | if ($ret !== '') |
165 | 165 | { |
166 | - $this->emit('data', [ $this, $ret ]); |
|
166 | + $this->emit('data', [$this, $ret]); |
|
167 | 167 | |
168 | 168 | if (strlen($ret) < $length) |
169 | 169 | { |
170 | 170 | $this->loop->removeReadStream($this->resource); |
171 | 171 | $this->reading = false; |
172 | - $this->emit('end', [ $this ]); |
|
172 | + $this->emit('end', [$this]); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | protected function getHandleReadFunction() |
183 | 183 | { |
184 | - return [ $this, 'handleRead' ]; |
|
184 | + return [$this, 'handleRead']; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | $this->writeEnd(); |
221 | 221 | } |
222 | 222 | |
223 | - $this->emit('close', [ $this ]); |
|
223 | + $this->emit('close', [$this]); |
|
224 | 224 | $this->handleClose(); |
225 | - $this->emit('done', [ $this ]); |
|
225 | + $this->emit('done', [$this]); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | if ($sent === false) |
239 | 239 | { |
240 | - $this->emit('error', [ $this, new WriteException('Error occurred while writing to the stream resource.') ]); |
|
240 | + $this->emit('error', [$this, new WriteException('Error occurred while writing to the stream resource.')]); |
|
241 | 241 | return; |
242 | 242 | } |
243 | 243 | |
@@ -247,14 +247,14 @@ discard block |
||
247 | 247 | |
248 | 248 | if ($lenAfter > 0 && $lenBefore >= $this->bufferSize && $lenAfter < $this->bufferSize) |
249 | 249 | { |
250 | - $this->emit('drain', [ $this ]); |
|
250 | + $this->emit('drain', [$this]); |
|
251 | 251 | } |
252 | 252 | else if ($lenAfter === 0) |
253 | 253 | { |
254 | 254 | $this->loop->removeWriteStream($this->resource); |
255 | 255 | $this->writing = false; |
256 | - $this->emit('drain', [ $this ]); |
|
257 | - $this->emit('finish', [ $this ]); |
|
256 | + $this->emit('drain', [$this]); |
|
257 | + $this->emit('finish', [$this]); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
@@ -270,19 +270,19 @@ discard block |
||
270 | 270 | |
271 | 271 | if ($ret === false) |
272 | 272 | { |
273 | - $this->emit('error', [ $this, new ReadException('Error occurred while reading from the stream resource.') ]); |
|
273 | + $this->emit('error', [$this, new ReadException('Error occurred while reading from the stream resource.')]); |
|
274 | 274 | return; |
275 | 275 | } |
276 | 276 | |
277 | 277 | if ($ret !== '') |
278 | 278 | { |
279 | - $this->emit('data', [ $this, $ret ]); |
|
279 | + $this->emit('data', [$this, $ret]); |
|
280 | 280 | |
281 | 281 | if (strlen($ret) < $length) |
282 | 282 | { |
283 | 283 | $this->loop->removeReadStream($this->resource); |
284 | 284 | $this->reading = false; |
285 | - $this->emit('end', [ $this ]); |
|
285 | + $this->emit('end', [$this]); |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | protected function getHandleReadFunction() |
308 | 308 | { |
309 | - return [ $this, 'handleRead' ]; |
|
309 | + return [$this, 'handleRead']; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | protected function getHandleWriteFunction() |
318 | 318 | { |
319 | - return [ $this, 'handleWrite' ]; |
|
319 | + return [$this, 'handleWrite']; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | ); |
91 | 91 | } |
92 | 92 | |
93 | - $this->emit('drain', [ $this ]); |
|
94 | - $this->emit('finish', [ $this ]); |
|
93 | + $this->emit('drain', [$this]); |
|
94 | + $this->emit('finish', [$this]); |
|
95 | 95 | |
96 | 96 | return true; |
97 | 97 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | $this->readable = false; |
112 | 112 | $this->writable = false; |
113 | 113 | |
114 | - $this->emit('close', [ $this ]); |
|
114 | + $this->emit('close', [$this]); |
|
115 | 115 | $this->handleClose(); |
116 | - $this->emit('done', [ $this ]); |
|
116 | + $this->emit('done', [$this]); |
|
117 | 117 | } |
118 | 118 | } |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | } |
97 | 97 | else if ($ret !== '') |
98 | 98 | { |
99 | - $this->emit('data', [ $this, $ret ]); |
|
99 | + $this->emit('data', [$this, $ret]); |
|
100 | 100 | |
101 | 101 | if (strlen($ret) < $length) |
102 | 102 | { |
103 | - $this->emit('end', [ $this ]); |
|
103 | + $this->emit('end', [$this]); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | $this->readable = false; |
123 | 123 | $this->writable = false; |
124 | 124 | |
125 | - $this->emit('close', [ $this ]); |
|
125 | + $this->emit('close', [$this]); |
|
126 | 126 | $this->handleClose(); |
127 | - $this->emit('done', [ $this ]); |
|
127 | + $this->emit('done', [$this]); |
|
128 | 128 | } |
129 | 129 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | ); |
108 | 108 | } |
109 | 109 | |
110 | - $this->emit('drain', [ $this ]); |
|
111 | - $this->emit('finish', [ $this ]); |
|
110 | + $this->emit('drain', [$this]); |
|
111 | + $this->emit('finish', [$this]); |
|
112 | 112 | |
113 | 113 | return true; |
114 | 114 | } |
@@ -141,11 +141,11 @@ discard block |
||
141 | 141 | } |
142 | 142 | else if ($ret !== '') |
143 | 143 | { |
144 | - $this->emit('data', [ $this, $ret ]); |
|
144 | + $this->emit('data', [$this, $ret]); |
|
145 | 145 | |
146 | 146 | if (strlen($ret) < $length) |
147 | 147 | { |
148 | - $this->emit('end', [ $this ]); |
|
148 | + $this->emit('end', [$this]); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | $this->readable = false; |
168 | 168 | $this->writable = false; |
169 | 169 | |
170 | - $this->emit('close', [ $this ]); |
|
170 | + $this->emit('close', [$this]); |
|
171 | 171 | $this->handleClose(); |
172 | - $this->emit('done', [ $this ]); |
|
172 | + $this->emit('done', [$this]); |
|
173 | 173 | } |
174 | 174 | } |