Small library to abstract the way to halt the program.
composer require innmind/time-warpuse Innmind\TimeWarp\Halt;
use Innmind\TimeContinuum\Period;
function yourApp(Halt $halt): void
{
// do something
$halt(Period::minute(42))->unwrap();
// do some more
}
yourApp(Halt::new());This example will halt your program for 42 minutes.
use Innmind\TimeWarp\Halt;
use Psr\Log\LoggerInterface;
$halt = Halt::logger($halt, /** an instance of LoggerInterface */);