Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class BiblePassageCollection implements ArrayAccess |
||
11 | { |
||
12 | protected $passages = []; |
||
13 | |||
14 | public function __construct(BiblePassage ...$passages) |
||
17 | } |
||
18 | |||
19 | public function offsetExists($key): bool |
||
20 | { |
||
21 | return array_key_exists($key, $this->passages); |
||
22 | } |
||
23 | |||
24 | public function offsetGet($key): BiblePassage |
||
27 | } |
||
28 | |||
29 | public function offsetSet($key, $value): void |
||
30 | { |
||
31 | throw new BadMethodCallException('Bible Passage Collections are immutable'); |
||
32 | } |
||
33 | |||
34 | public function offsetUnset($key) |
||
37 | } |
||
38 | } |
||
39 |