/** */ private function onTick() { try { $this->lastResult = $this->task->__invoke($this); ++$this->iterations; if ($this->timer->isPeriodic()) { $this->deferred()->notify($this->lastResult); if ($this->maxIterations() !== null && $this->iterations() >= $this->maxIterations()) { $this->cancel(); } } else { $this->deferred()->resolve($this->lastResult); } } catch (\Exception $e) { $this->deferred()->reject($e); $this->timer->cancel(); } }
/** * {@inheritdoc} */ protected function notify($state = null) { $this->notify->__invoke($state); }
/** * {@inheritdoc} */ public function compare($a, $b) { return $this->callbackDelegate->__invoke($a, $b); }
/** * {@inheritdoc} */ public function equals($a, $b) { return $this->callbackDelegate->__invoke($a, $b); }
/** * {@inheritdoc} */ public function compare($a, $b) { return $this->direction()->value() * parent::compare($this->selector->__invoke($a), $this->selector->__invoke($b)); }
/** * {@inheritdoc} */ public function apply($value) { return $this->callbackDelegate->__invoke($value); }
/** * @return static */ public function createQueryBuilder() { return $this->factory->__invoke(); }