private function hasPassed(TaskExecutionInterface $execution, $result)
    {
        // this find is necessary because the storage could be
        // invalid (clear in doctrine) after handling an execution.
        $execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
        $execution->setStatus(TaskStatus::COMPLETED);
        $execution->setResult($result);

        $this->eventDispatcher->dispatch(
            Events::TASK_PASSED,
            new TaskExecutionEvent($execution->getTask(), $execution)
        );

        return $execution;
    }
private function hasPassed(TaskExecutionInterface $execution, $result)
    {
        // this find is necessary because the storage could be
        // invalid (clear in doctrine) after handling an execution.
        $execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
        $execution->setStatus(TaskStatus::COMPLETED);
        $execution->setResult($result);

        $this->eventDispatcher->dispatch(
            Events::TASK_PASSED,
            new TaskExecutionEvent($execution->getTask(), $execution)
        );

        return $execution;
    }
private function hasPassed ( TaskExecutionInterface $ execution , $ result ) { // this find is necessary because the storage could be // invalid (clear in doctrine) after handling an execution. $ execution = $ this -> taskExecutionRepository -> findByUuid ( $ execution -> getUuid ( ) ) ; $ execution -> setStatus ( TaskStatus :: COMPLETED ) ; $ execution -> setResult ( $ result ) ; $ this -> eventDispatcher -> dispatch ( Events :: TASK_PASSED , new TaskExecutionEvent ( $ execution -> getTask ( ) , $ execution ) ) ; return $ execution ; }
The given task passed the run.

@param TaskExecutionInterface $execution
@param mixed $result

@return TaskExecutionInterface
The given task passed the run .