yaroslawww/http-statuscodes
Composer 安装命令:
composer require yaroslawww/http-statuscodes
包简介
PHP library for handling HTTP status codes
README 文档
README
Installation
You can install the package via composer:
composer require yaroslawww/http-statuscodes
Simple example
$manager = new \HttpStatusCodes\StatusCodeManager(); $statusCode = $manager->makeStatusCode(201); if($statusCode) { $statusCode->getMessage(); $statusCode->getCode(); $statusCode->getDescription(); $statusCode->getRFCNumber(); }
$manager = new \HttpStatusCodes\StatusCodeManager(); $statusCode = $manager->makeStatusCode('HTTP_OK'); if($statusCode) { $statusCode->getMessage(); $statusCode->getCode(); $statusCode->getDescription(); $statusCode->getRFCNumber(); }
class CustomStatusCodes { /** * @rfc 1133 * @description Test Description New Ok * @message OKAY! */ const HTTP_OKAY = 3333; } $manager = new \HttpStatusCodes\StatusCodeManager(); $statusCode = $manager->makeStatusCode(3333); if($statusCode) { $statusCode->getMessage(); $statusCode->getCode(); $statusCode->getDescription(); $statusCode->getRFCNumber(); }
Testing
./vendor/bin/phpunit
# or
composer test
Security
If you discover any security related issues, please email yaroslav.georgitsa@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 169
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-16