ramsondon/arraycollectionfactory
Composer 安装命令:
composer require ramsondon/arraycollectionfactory
包简介
a type save array generator via type hinting
README 文档
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(); }
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-10-02