1 | <?php |
||
10 | abstract class TypedArray extends \ArrayObject |
||
11 | { |
||
12 | /** |
||
13 | * Define the class that will be used for all items in the array. |
||
14 | * To be defined in each sub-class. |
||
15 | */ |
||
16 | const ARRAY_TYPE = null; |
||
17 | |||
18 | /** |
||
19 | * Define the type of element for the array. |
||
20 | */ |
||
21 | private $arrayType; |
||
22 | |||
23 | /** |
||
24 | * TypedArray constructor. |
||
25 | * |
||
26 | * @param array|object $input The input parameter accepts an array or an Object |
||
27 | * @param int $flags Flags to control the behaviour of the ArrayObject object |
||
28 | * @param string $iterator_class Specify the class that will be used for iteration of the ArrayObject object. ArrayIterator is the default class used |
||
29 | 15 | */ |
|
30 | public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator') |
||
75 | |||
76 | /** |
||
77 | * Clone a collection by cloning all items. |
||
78 | 1 | */ |
|
79 | public function __clone() |
||
85 | |||
86 | /** |
||
87 | * Check the type and then store the value. |
||
88 | * |
||
89 | * @param int|null $offset The offset to store the value at or null to append the value |
||
90 | * @param mixed $value The value to store |
||
91 | 9 | */ |
|
92 | public function offsetSet($offset, $value) |
||
122 | } |
||
123 |