Skip to content

Commit 5166af7

Browse files
committed
Mark connection handler as internal
1 parent e4fb0f2 commit 5166af7

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/Server.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Server extends EventEmitter implements ServerInterface
100100
* and/or PHP version.
101101
* Passing unknown context options has no effect.
102102
*
103-
* @param string $uri
103+
* @param string|int $uri
104104
* @param LoopInterface $loop
105105
* @param array $context
106106
* @throws InvalidArgumentException if the listening address is invalid
@@ -165,15 +165,6 @@ public function __construct($uri, LoopInterface $loop, array $context = array())
165165
});
166166
}
167167

168-
public function handleConnection($socket)
169-
{
170-
stream_set_blocking($socket, 0);
171-
172-
$client = $this->createConnection($socket);
173-
174-
$this->emit('connection', array($client));
175-
}
176-
177168
public function getAddress()
178169
{
179170
if (!is_resource($this->master)) {
@@ -203,8 +194,11 @@ public function close()
203194
$this->removeAllListeners();
204195
}
205196

206-
public function createConnection($socket)
197+
/** @internal */
198+
public function handleConnection($socket)
207199
{
208-
return new Connection($socket, $this->loop);
200+
$this->emit('connection', array(
201+
new Connection($socket, $this->loop)
202+
));
209203
}
210204
}

tests/ServerTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ public function setUp()
3030
}
3131

3232
/**
33-
* @covers React\EventLoop\StreamSelectLoop::tick
3433
* @covers React\Socket\Server::handleConnection
35-
* @covers React\Socket\Server::createConnection
3634
*/
3735
public function testConnection()
3836
{
@@ -43,9 +41,7 @@ public function testConnection()
4341
}
4442

4543
/**
46-
* @covers React\EventLoop\StreamSelectLoop::tick
4744
* @covers React\Socket\Server::handleConnection
48-
* @covers React\Socket\Server::createConnection
4945
*/
5046
public function testConnectionWithManyClients()
5147
{

0 commit comments

Comments
 (0)