ramsondon / arraycollectionfactory
a type save array generator via type hinting
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ramsondon/arraycollectionfactory
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-12-30 14:16:47 UTC
README
ArrayCollectionFactory is a dynamic ArrayCollection generator for type save access via type hints in PHP.
the ArrayCollection implements \Countable, \Iterator and the dynamically created cached ArrayCollection contains the methods:
->append(Class\of\Object $object);
->getAt($index);
->removeAt($index);
try phpunit in directory src/Ramsondon/TypedArray/Test to generate cached ArrayCollection and Interface.
the cached files will be created in src/Ramsondon/TypedArray/Cache
How to use:
use Ramsondon\ArrayCollectionFactory; $factroy = new ArrayCollectionFactory(); /* @var $collection \Ramsondon\TypedArray\Cache\ITestObjectArrayCollection */ $collection = $factory->create('Class\\Of\\TestObject'); $object = new Class\Of\TestObject(); $collection->append($object); /* @var $testobject \Class\Of\TestObject */ foreach ($collection as $testobject) { $testobject->doSomething(); }