phpextra/unknown
Composer 安装命令:
composer require phpextra/unknown
包简介
Unknown type for PHP
README 文档
README
#UnknownType (PHPExtra\Type\UnknownType)
##Usage
It should not happen but sometimes does - you have a method with many different response types, but want to handle it like a pro:
$messedUpResponse = $api->getMeSomeChickens(); // returns "Chicken" **or** "Collection" **of** "Chickens" **or** "no" as an error response :-) $result = new UnknownType($messedUpResponse); if($result->isCollection()){ $result->getAsCollection()->sort($sorter); ... }elseif($result->isException){ throw $result->getAsException(); ... }
UnknownType can be extended and customized :-)
Installation (Composer)
{
"require": {
"phpextra/unknown":"~1.0"
}
}
##Changelog
No releases yet
##Contributing
All code contributions must go through a pull request. Fork the project, create a feature branch, and send me a pull request. To ensure a consistent code base, you should make sure the code follows the coding standards. If you would like to help take a look at the list of issues.
##Requirements
See composer.json for a full list of dependencies.
##Authors
Jacek Kobus - <kobus.jacek@gmail.com>
License information
See the file LICENSE.txt for copying permission.on.
统计信息
- 总下载量: 8.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-08-16