innmind / time-warp
时间扭曲
3.0.0
2022-02-06 10:27 UTC
Requires
- php: ~8.0
- innmind/time-continuum: ~3.0
- psr/log: ~3.0
Requires (Dev)
- innmind/coding-standard: ~2.0
- phpunit/phpunit: ~9.0
- vimeo/psalm: ~4.1
This package is auto-updated.
Last update: 2024-09-06 15:38:06 UTC
README
一个小型库,用于抽象程序挂起的方式。
目前这个库只能在地球上使用,请勿在火星或其他宇宙中任何地方使用。
安装
composer require innmind/time-warp
用法
use Innmind\TimeWarp\{ Halt\Usleep, Halt, }; use Innmind\TimeContinuum\Earth\Period\Minute; function yourApp(Halt $halt): void { // do something $halt(new Minute(42)); // do some more } yourApp(new Usleep);
此示例将使您的程序停止42分钟。
日志记录
use Innmind\TimeWarp\Halt\Logger; use Psr\Log\LoggerInterface; $halt = Logger::psr($halt, /** an instance of LoggerInterface */);