/**
  * @param LoopEvent $event
  */
 public function checkExecutions(LoopEvent $event)
 {
     $repeat = $event->getConfig()->getRepeat();
     $this->executions += 1;
     if (null !== $repeat && $repeat <= $this->executions) {
         throw new LoopException('maximum loop executions reached', 0, $event->getException());
     }
 }
 /**
  * @param LoopEvent $event
  */
 public function checkStatus(LoopEvent $event)
 {
     if ($event->getTarget()->isStopped()) {
         throw new LoopException('Loop has been stopped', 0, $event->getException());
     }
 }