Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.8846 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 4 | public function getInnerToc(): TableOfContents |
|
25 | { |
||
26 | 4 | $children = $this->children(); |
|
27 | 4 | $children = \iterator_to_array($children); |
|
|
|||
28 | 4 | if (\count($children) !== 2) { |
|
29 | throw new InvalidArgumentException( |
||
30 | 'TableOfContentsWrapper nodes should have 2 children, found ' . \count($children) |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | 4 | $inner = $children[1]; |
|
35 | 4 | if (! $inner instanceof TableOfContents) { |
|
36 | throw new InvalidArgumentException( |
||
37 | 'TableOfContentsWrapper second node should be a TableOfContents, found ' . \get_class($inner) |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | 4 | return $inner; |
|
42 | } |
||
44 |