zzepish/strict-array

StrictArray allows you to set type of array value inserted

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/zzepish/strict-array

1.1.13 2018-10-21 16:00 UTC

This package is auto-updated.

Last update: 2025-09-22 07:55:52 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