Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
47 | 6 | public function getIndex(?string $name = null): Index |
|
48 | { |
||
49 | 6 | if (null === $name) { |
|
50 | 1 | return $this->defaultIndex; |
|
51 | } |
||
52 | |||
53 | 5 | if (!isset($this->indexes[$name])) { |
|
54 | 1 | throw new \InvalidArgumentException(\sprintf('The index "%s" does not exist', $name)); |
|
55 | } |
||
56 | |||
57 | 4 | return $this->indexes[$name]; |
|
58 | } |
||
59 | |||
68 |