blainesch/prettyarray
Composer 安装命令:
composer require blainesch/prettyarray
包简介
Manipulate arrays similar to Ruby.
README 文档
README
A object oriented approach to handling arrays in PHP. It attempts to combine Ruby (enumerator/array/hash) methods as well as built in PHP functions.
Example 1
<?php use prettyArray\PrettyArray; $arr = new PrettyArray(range(1,6)); $arr->group_by_(function($key, &$value) { return ($value % 3); }); print_r($arr->to_a()); ?>
Array
(
[0] => Array
(
[0] => 3
[1] => 6
)
[1] => Array
(
[0] => 1
[1] => 4
)
[2] => Array
(
[0] => 2
[1] => 5
)
)
More Examples
More examples can be found inside of the "/examples" directory in markdown format which is viewable on Github.
Installation
GIT
git clone git://github.com/BlaineSch/prettyArray.git
# OR
git submodule add git://github.com/BlaineSch/prettyArray.git
Composer
"require": { "blainesch/prettyarray": "1.0.0" }
php compooser.phar install
Requirements
Contributing
Requirements
Testing
Before making any pull requests please verify that your methods pass the current unit tests.
cd PrettyArray && phpunit
PHPUnit 3.6.12 by Sebastian Bergmann.
Configuration read from /Users/blaineschmeisser/Sites/devup/PrettyArray/phpunit.xml
............................................................... 63 / 159 ( 39%)
............................................................... 126 / 159 ( 79%)
.................................
Time: 1 second, Memory: 10.00Mb
OK (159 tests, 180 assertions)
Test Files
- PrettyArray Test - Tests the core functionality of PrettyArray.
- Enumerator Test - Tests all the core methods inside of enumerator.
- Exception Test - Tests all methods specifically if they are handling exceptions correctly.
统计信息
- 总下载量: 19.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: The
- 更新时间: 2013-08-21