zzepish / strict-array
StrictArray allows you to set type of array value inserted
1.1.13
2018-10-21 16:00 UTC
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^7.4
README
<?php
use StrictArray\StrictArray;
$dateTimeCollection = new StrictArray(\DateTime::class);
$dateTimeCollection[] = new \DateTime();
$integerCollection = new StrictArray('integer');
$integerCollection[] = 12;
$dateTimeCollection[] = 13 // will throw IncorrectValueTypeException