1 | <?php |
||
14 | class ConstCollection implements |
||
15 | \ArrayAccess, |
||
16 | \Countable, |
||
17 | \IteratorAggregate |
||
18 | { |
||
19 | private $collection; |
||
20 | |||
21 | 3 | function __construct(Collection $c) |
|
25 | |||
26 | /** |
||
27 | * 内部のCollectionのデータを読み出します |
||
28 | * @param int $offset |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 1 | function offsetGet($offset) |
|
35 | |||
36 | /** |
||
37 | * 書き換えは禁止されています |
||
38 | */ |
||
39 | 1 | final function offsetSet($offset, $value) |
|
43 | |||
44 | /** |
||
45 | * 書き換えは禁止されています |
||
46 | */ |
||
47 | 1 | final function offsetUnset($offset) |
|
51 | |||
52 | /** |
||
53 | * 要素が実在するかを調べます |
||
54 | * @param int $offset |
||
55 | * @return bool |
||
56 | */ |
||
57 | 1 | function offsetExists($offset) |
|
61 | |||
62 | /** |
||
63 | * @return \ArrayIterator |
||
64 | */ |
||
65 | 1 | function getIterator() |
|
69 | |||
70 | /** |
||
71 | * @return int |
||
72 | */ |
||
73 | 1 | function count() |
|
77 | } |
||
78 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.