| Conditions | 2 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 58 | protected function emit($event, array $data, Closure $callback = null) |
||
| 59 | { |
||
| 60 | try { |
||
| 61 | $eventData = [ |
||
| 62 | 'event' => $event, |
||
| 63 | 'data' => $data, |
||
| 64 | ]; |
||
| 65 | |||
| 66 | $sendData = (string) @json_encode($eventData); |
||
| 67 | |||
| 68 | 3 | $this->websocket->send($sendData); |
|
| 69 | |||
| 70 | $this->error = null; |
||
| 71 | |||
| 72 | 3 | return true; |
|
| 73 | 3 | ||
| 74 | 3 | } catch (Exception $e) { |
|
| 75 | $this->error = $e->getMessage(); |
||
| 76 | 3 | return false; |
|
| 77 | } |
||
| 78 | 3 | } |
|
| 79 | |||
| 90 |
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..