Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function addChild(Item $item): NavigationItem |
||
38 | { |
||
39 | if (!$item instanceof NavigationItem) { |
||
40 | throw new \InvalidArgumentException( |
||
41 | sprintf("Item must be instance of %s'", NavigationItem::class) |
||
42 | ); |
||
43 | } |
||
44 | |||
45 | $this->children[] = $item->setParent($this); |
||
46 | |||
47 | return $this; |
||
48 | } |
||
49 | |||
93 |