Total Complexity | 6 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
20 | class Record extends Element implements RecordInterface |
||
21 | { |
||
22 | use Edgeable; |
||
23 | |||
24 | /** @var Vertex */ |
||
25 | protected $vertex; |
||
26 | |||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | public function __toString() |
||
31 | { |
||
32 | return sprintf('<%s> %s\\l', explode(' ', $this->getId())[0], $this->getId()); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Get graph. |
||
37 | * |
||
38 | * @return GraphInterface|null |
||
39 | */ |
||
40 | public function getGraph(): ?GraphInterface |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Record constructor. |
||
47 | * |
||
48 | * @param null|string $id |
||
49 | * @param null|VertexInterface $vertex |
||
50 | */ |
||
51 | public function __construct(string $id = null, VertexInterface $vertex = null) |
||
56 | } |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Get vertex. |
||
61 | * |
||
62 | * @return VertexInterface |
||
63 | */ |
||
64 | public function getVertex(): ?VertexInterface |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * Set vertex. |
||
71 | * |
||
72 | * @param VertexInterface $vertex |
||
73 | */ |
||
74 | public function setVertex(VertexInterface $vertex): void |
||
79 |
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.