Skip to content

Commit 8997565

Browse files
committed
Remove unneeded and undocumented loop argument for stream listeners
1 parent 7c7aae9 commit 8997565

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/ExtEventLoop.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ private function createStreamCallback()
289289
$key = (int) $stream;
290290

291291
if (Event::READ === (Event::READ & $flags) && isset($this->readListeners[$key])) {
292-
call_user_func($this->readListeners[$key], $stream, $this);
292+
call_user_func($this->readListeners[$key], $stream);
293293
}
294294

295295
if (Event::WRITE === (Event::WRITE & $flags) && isset($this->writeListeners[$key])) {
296-
call_user_func($this->writeListeners[$key], $stream, $this);
296+
call_user_func($this->writeListeners[$key], $stream);
297297
}
298298
};
299299
}

src/LibEvLoop.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function addReadStream($stream, callable $listener)
4040
}
4141

4242
$callback = function () use ($stream, $listener) {
43-
call_user_func($listener, $stream, $this);
43+
call_user_func($listener, $stream);
4444
};
4545

4646
$event = new IOEvent($callback, $stream, IOEvent::READ);
@@ -59,7 +59,7 @@ public function addWriteStream($stream, callable $listener)
5959
}
6060

6161
$callback = function () use ($stream, $listener) {
62-
call_user_func($listener, $stream, $this);
62+
call_user_func($listener, $stream);
6363
};
6464

6565
$event = new IOEvent($callback, $stream, IOEvent::WRITE);

src/LibEventLoop.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ private function createStreamCallback()
307307
$key = (int) $stream;
308308

309309
if (EV_READ === (EV_READ & $flags) && isset($this->readListeners[$key])) {
310-
call_user_func($this->readListeners[$key], $stream, $this);
310+
call_user_func($this->readListeners[$key], $stream);
311311
}
312312

313313
if (EV_WRITE === (EV_WRITE & $flags) && isset($this->writeListeners[$key])) {
314-
call_user_func($this->writeListeners[$key], $stream, $this);
314+
call_user_func($this->writeListeners[$key], $stream);
315315
}
316316
};
317317
}

src/StreamSelectLoop.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ private function waitForStreamActivity($timeout)
206206
$key = (int) $stream;
207207

208208
if (isset($this->readListeners[$key])) {
209-
call_user_func($this->readListeners[$key], $stream, $this);
209+
call_user_func($this->readListeners[$key], $stream);
210210
}
211211
}
212212

213213
foreach ($write as $stream) {
214214
$key = (int) $stream;
215215

216216
if (isset($this->writeListeners[$key])) {
217-
call_user_func($this->writeListeners[$key], $stream, $this);
217+
call_user_func($this->writeListeners[$key], $stream);
218218
}
219219
}
220220
}

tests/StreamSelectLoopTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public function testSignalInterruptWithStream($signal)
9090

9191
// add stream to the loop
9292
list($writeStream, $readStream) = $this->createSocketPair();
93-
$this->loop->addReadStream($readStream, function($stream, $loop) {
93+
$this->loop->addReadStream($readStream, function ($stream) {
9494
/** @var $loop LoopInterface */
9595
$read = fgets($stream);
9696
if ($read === "end loop\n") {
97-
$loop->stop();
97+
$this->loop->stop();
9898
}
9999
});
100100
$this->loop->addTimer(0.05, function() use ($writeStream) {

0 commit comments

Comments
 (0)