public function onRunCompleted(RunEvent $event)
    {
        $index = array_search($event->getRun(), $this->running, true);
        if ($index !== false) {
            unset($this->running[$index]);
        }
        $this->complete[] = $event->getRun();
        $this->dispatch(RunEvent::UPDATED, new RunEvent($this));
        if (count($this->waiting) === 0 && count($this->running) === 0) {
            $this->setFinished();
            if ($this->isSuccessful()) {
                $this->dispatch(RunEvent::SUCCESSFUL, new RunEvent($this));
            } else {
                $this->dispatch(RunEvent::FAILED, new RunEvent($this));
            }
            $this->dispatch(RunEvent::COMPLETED, new RunEvent($this));
        }
    }
public function onRunCompleted(RunEvent $event)
    {
        $index = array_search($event->getRun(), $this->running, true);
        if ($index !== false) {
            unset($this->running[$index]);
        }
        $this->complete[] = $event->getRun();
        $this->dispatch(RunEvent::UPDATED, new RunEvent($this));
        if (count($this->waiting) === 0 && count($this->running) === 0) {
            $this->setFinished();
            if ($this->isSuccessful()) {
                $this->dispatch(RunEvent::SUCCESSFUL, new RunEvent($this));
            } else {
                $this->dispatch(RunEvent::FAILED, new RunEvent($this));
            }
            $this->dispatch(RunEvent::COMPLETED, new RunEvent($this));
        }
    }
public function onRunCompleted ( RunEvent $ event ) { $ index = array_search ( $ event -> getRun ( ) , $ this -> running , true ) ; if ( $ index !== false ) { unset ( $ this -> running [ $ index ] ) ; } $ this -> complete [ ] = $ event -> getRun ( ) ; $ this -> dispatch ( RunEvent :: UPDATED , new RunEvent ( $ this ) ) ; if ( count ( $ this -> waiting ) === 0 && count ( $ this -> running ) === 0 ) { $ this -> setFinished ( ) ; if ( $ this -> isSuccessful ( ) ) { $ this -> dispatch ( RunEvent :: SUCCESSFUL , new RunEvent ( $ this ) ) ; } else { $ this -> dispatch ( RunEvent :: FAILED , new RunEvent ( $ this ) ) ; } $ this -> dispatch ( RunEvent :: COMPLETED , new RunEvent ( $ this ) ) ; } }
When a run is completed, check if everything has finished

@param RunEvent $event
When a run is completed check if everything has finished