zuffik/srvant
Composer 安装命令:
composer require zuffik/srvant
包简介
Data structures and object wrappers for primitive data types
README 文档
README
srvant
srvant is your little but helpful package that improves PHP usability.
Docs
Installation
simply...
composer require zuffik/srvant
Usage
Structures
Lists:
- Array List
- Linked List
Maps:
- Hash map
example:
$list = new ArrayList(); $list->add(1, 2, 3, -1); foreach($list as $item) { echo $item . "\n"; } // And equivalent $list->map(function($item) { echo $item . "\n"; return $item; })->filter(function($item) { return $item > 0; }); // And many more
Full documentation available here.
String
Offers interface with string functions.
example:
$str = string('Hallo world') ->replace('a', 'e') ->lowerCase() ->slugify() ->upperCase(); echo $str; // HELLO-WORLD
Full documentation available here.
Formats
- CSV
- JSON
- Regex
- URL
All of these offer a interface for work with certain data format.
example:
$url = new URL('http://sub.example.com/index.php?action=page'); echo $url->getDomain(); // example echo $url->getRequestedUrl(); // index.php
Full documentation available here.
There are planned many features in future.
Sources
As for mime types, this magic database is used
Contribution
Contribution is simple. Make pull request with your new or edited code. It MUST follow PSR coding standards. For new feature provide also unit tests.
Donate
If you are satisfied with srvant, please donate. Thank you all. :)
统计信息
- 总下载量: 166
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-31