| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function start(): void { |
||
| 39 | if ($this->tcpServer !== null) { |
||
| 40 | return; |
||
| 41 | } |
||
| 42 | |||
| 43 | $ip = $this->config['ip'] ?? '0.0.0.0'; |
||
| 44 | $port = $this->config['port'] ?? '2341'; |
||
| 45 | |||
| 46 | $this->tcpServer = new \React\Socket\TcpServer($ip . ':' . $port); |
||
| 47 | |||
| 48 | $this->tcpServer->on('connection', function (ConnectionInterface $connection) { |
||
| 49 | |||
| 50 | $connection->pipe($connection); |
||
| 51 | |||
| 52 | $connection->on('data', function ($payload) { |
||
| 53 | foreach ($this->consumers as $consumer) { |
||
| 54 | $consumer->handle($payload); |
||
| 55 | } |
||
| 74 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..