Total Complexity | 4 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class ArrayMap extends AbstractArray |
||
6 | { |
||
7 | protected $offsetType; |
||
8 | |||
9 | 6 | public function __construct(string $offsetType, string $valueType) |
|
10 | { |
||
11 | 6 | $offsetAcceptedTypes = ['integer', 'string']; |
|
12 | 6 | if (!in_array(strtolower($offsetType), $offsetAcceptedTypes)) { |
|
13 | 1 | throw new \InvalidArgumentException('Offest type must be of type: ' . implode(', ', $offsetAcceptedTypes) . '.'); |
|
14 | } |
||
15 | |||
16 | 5 | parent::__construct($valueType); |
|
17 | 5 | $this->offsetType = $offsetType; |
|
18 | 5 | } |
|
19 | |||
20 | 4 | protected function checkOffset($offset): void |
|
24 | } |
||
25 | } |
||
26 | } |