Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4.125 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 4 | public function getInnerToc(): TableOfContents |
|
21 | { |
||
22 | 4 | $children = $this->children(); |
|
23 | 4 | if (count($children) != 2) { |
|
24 | throw new InvalidArgumentException( |
||
|
|||
25 | 'TableOfContentsWrapper nodes should have 2 children, found ' . count($children) |
||
26 | ); |
||
27 | } |
||
28 | 4 | $inner = $children[1]; |
|
29 | 4 | if (! $inner instanceof TableOfContents) { |
|
30 | throw new InvalidArgumentException( |
||
31 | 'TableOfContentsWrapper second node should be a TableOfContents, found ' . get_class($inner) |
||
32 | ); |
||
33 | } |
||
34 | 4 | return $inner; |
|
35 | } |
||
37 |