codedruids/black-hole
Composer 安装命令:
composer require --dev codedruids/black-hole
包简介
Testing class that ignores everything while still being valid
README 文档
README
BlackHole is a PHP testing class that ignores anything done to it.
Requirements
- PHP 5.6 or higher
Installation
Add the following to your composer.json:
{
"require": {
"CodeDruids/black-hole": "1.*"
}
}
Basic Usage
$test = new \CodeDruids\BlackHole("test"); $test->a = "b"; unset($test->c); isset($test->d) $test->e("f"); \CodeDruids\BlackHole::g("h") var_dump($test); echo $test; $test();
This can be useful when you need a placeholder object, or want the ability to switch a class alias to remove any impact on a production environment. e.g.
if (env('APP_ENV') == 'production') { class_alias('CodeDruids\BlackHole', 'Debug'); } else { class_alias('My\Clever\Debugger', 'Debug'); } Debug::log('Profound silence');
Support
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
统计信息
- 总下载量: 175
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-05