| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | trait TreeItemTrait |
||
| 8 | { |
||
| 9 | /** @var self|null */ |
||
| 10 | protected $parent; |
||
| 11 | /** @var self[] */ |
||
| 12 | protected $children = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param self|AbstractEntity $item |
||
| 16 | */ |
||
| 17 | public function setParent(AbstractEntity $item) |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return self|null |
||
| 24 | */ |
||
| 25 | public function getParent() |
||
| 26 | { |
||
| 27 | return $this->parent; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param self|AbstractEntity $item |
||
| 32 | */ |
||
| 33 | public function addChild(AbstractEntity $item) |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return self[] |
||
| 40 | */ |
||
| 41 | public function getChildren(): array |
||
| 46 |
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..