| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function read(FramePickerInterface $picker, Context $context, $isOutOfBand) |
|
| 24 | { |
||
| 25 | 2 | $client = stream_socket_accept($this->socket->getStreamResource(), 0, $peerName); |
|
| 26 | 2 | if ($client === false) { |
|
| 27 | 1 | throw new AcceptException($this->socket, 'Can not accept client connection.'); |
|
| 28 | } |
||
| 29 | |||
| 30 | 1 | return new AcceptedFrame( |
|
| 31 | 1 | $peerName ?: '', |
|
| 32 | 1 | new AcceptedSocket($client) |
|
| 33 | 1 | ); |
|
| 34 | } |
||
| 35 | } |
||
| 36 |