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