zzepish/strict-array

StrictArray allows you to set type of array value inserted

Maintainers

Package info

bitbucket.org/Zzepish/strictarray

pkg:composer/zzepish/strict-array

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

1.1.13 2018-10-21 16:00 UTC

This package is auto-updated.

Last update: 2026-02-22 08:53:29 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