zzepish/strict-array

StrictArray allows you to set type of array value inserted

1.1.13 2018-10-21 16:00 UTC

This package is auto-updated.

Last update: 2024-04-22 04:22:36 UTC


README

<?php
use StrictArray\StrictArray;

$dateTimeCollection = new StrictArray(\DateTime::class);
$dateTimeCollection[] = new \DateTime();

$integerCollection = new StrictArray('integer');
$integerCollection[] = 12;

$dateTimeCollection[] = 13 // will throw IncorrectValueTypeException