ilya / collection
无痛PHP集合。
1.0.0
2014-05-21 16:51 UTC
Requires (Dev)
- phpspec/phpspec: ~2
This package is not auto-updated.
Last update: 2024-09-14 14:36:59 UTC
README
无痛PHP集合。
安装
打开终端,cd 到您的项目目录并运行
composer require "ilya/collection:~1"
示例
$collection = new Collection\Collection([1, 2, 3]); $collection->all(); // => [1, 2, 3] $collection->sum(); // => 6 $collection->toJson(); // => "[1,2,3]"
文档
源代码已完全文档化,您可以使用如 ApiGen 等工具构建美观的HTML文档。
特性
支持的接口
JsonSerializable[完成]Countable[完成]ArrayAccess[完成]IteratorAggregate[完成]
提供的方法
all[完成]collapse[完成]difference[完成]each[完成]fetch[完成]filter[完成]first[完成]last[完成]flatten[完成]remove[完成]get[完成]groupBy[完成]has[完成]implode[完成]intersection[完成]isEmpty[完成]pluck[完成]map[完成]merge[完成]pop[完成]push[完成]prepend[完成]put[完成]reduce[完成]random[完成]reverse[完成]shift[完成]slice[完成]chunk[完成]sort[完成]sortBy[完成]splice[完成]sortByDesc[完成]sum[完成]take[完成]transform[完成]unique[完成]values[完成]
许可证
本项目采用MIT许可证。