wearesho-team/base-collection
最新稳定版本:1.0.2
Composer 安装命令:
composer require wearesho-team/base-collection
包简介
Typed collection based on ArrayObject
README 文档
README
Implementation of typed collection.
Installation
composer require wearesho-team/base-collection
Usage
Create your class collection and implement type() method.
It must return declared (existed) class name
<?php use Wearesho\BaseCollection; class MyCollection extends BaseCollection { public function type(): string { return stdClass::class; } }
And now you have typed collection!
If you try to append item that not instance of your type you will catch an InvalidArgumentException
Authors
License
统计信息
- 总下载量: 4.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-22