Kraken\_Unit\Loop\Timer\TimerBoxTest::createTimer PHP Метод

createTimer() публичный Метод

public createTimer ( float $interval = 1, callable $handler = null, boolean $periodic = false, mixed | null $data = null ) : Kraken\Loop\Timer\TimerInterface
$interval float
$handler callable
$periodic boolean
$data mixed | null
Результат Kraken\Loop\Timer\TimerInterface
    public function createTimer($interval = 1.0, callable $handler = null, $periodic = false, $data = null)
    {
        if (!isset($this->loop)) {
            $this->loop = new LoopModelMock();
        }
        $handler = $handler === null ? function () {
        } : $handler;
        return new Timer($this->loop, $interval, $handler, $periodic, $data);
    }