Skip to content

Commit 71addfc

Browse files
committed
Revert "Clean up annoying 5.3 $that = $this"
This reverts commit a16505d.
1 parent 9b3eba6 commit 71addfc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Server.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ public function listen($port, $host = '127.0.0.1')
3030
}
3131
stream_set_blocking($this->master, 0);
3232

33-
$this->loop->addReadStream($this->master, function ($master) {
33+
$that = $this;
34+
35+
$this->loop->addReadStream($this->master, function ($master) use ($that) {
3436
$newSocket = stream_socket_accept($master);
3537
if (false === $newSocket) {
36-
$this->emit('error', array(new \RuntimeException('Error accepting new connection')));
38+
$that->emit('error', array(new \RuntimeException('Error accepting new connection')));
3739

3840
return;
3941
}
40-
$this->handleConnection($newSocket);
42+
$that->handleConnection($newSocket);
4143
});
4244
}
4345

0 commit comments

Comments
 (0)