Total Complexity | 2 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class ServerStartEvent extends Event |
||
18 | { |
||
19 | /** |
||
20 | * @var Socket |
||
21 | */ |
||
22 | private $socket; |
||
23 | |||
24 | /** |
||
25 | * ServerStartEvent constructor. |
||
26 | * |
||
27 | * @param SocketInterface $socket |
||
28 | */ |
||
29 | public function __construct(SocketInterface $socket) |
||
30 | { |
||
31 | $this->socket = $socket; |
||
|
|||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return Socket |
||
36 | */ |
||
37 | public function getSocket(): Socket |
||
40 | } |
||
41 | } |
||
42 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.