Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
9 | 6 | public function __construct(string $offsetType, string $valueType, array $array = [], int $flags = 0, string $iteratorClass = "ArrayIterator") |
|
10 | { |
||
11 | 6 | $this->offsetType = $offsetType; |
|
12 | 6 | $offsetAcceptedTypes = ['integer', 'string']; |
|
13 | 6 | if (!in_array(strtolower($offsetType), $offsetAcceptedTypes)) { |
|
14 | 1 | throw new \InvalidArgumentException('Offest type must be of type: ' . implode(', ', $offsetAcceptedTypes) . '.'); |
|
15 | } |
||
16 | |||
17 | 5 | parent::__construct($valueType, $array, $flags, $iteratorClass); |
|
18 | 5 | } |
|
26 | } |