| 1 | <?php |
||
| 5 | abstract class AbstractTypedArray extends \ArrayIterator |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var callable |
||
| 9 | */ |
||
| 10 | private $test; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $type; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param callable $test The validation test to perform on new array entries |
||
| 19 | * @param string $type The name of the intended type |
||
| 20 | * @param array|null The source array |
||
| 21 | */ |
||
| 22 | 99 | public function __construct(callable $test, $type, array $source = null) |
|
| 35 | |||
| 36 | 66 | public function offsetSet($index, $newval) |
|
| 42 | |||
| 43 | 66 | private function verify(array $source) |
|
| 49 | |||
| 50 | 99 | private function verifyValue($value) |
|
| 56 | } |
||
| 57 |