Alex\BehatLauncher\Controller\RunController::stopAction PHP Méthode

stopAction() public méthode

public stopAction ( Request $request, $id )
$request Symfony\Component\HttpFoundation\Request
    public function stopAction(Request $request, $id)
    {
        try {
            $run = $this->getRunStorage()->getRun($id);
        } catch (\InvalidArgumentException $e) {
            throw $this->createNotFoundException(sprintf('Run #%s not found.', $id));
        }
        foreach ($run->getUnits() as $unit) {
            if ($unit->isPending()) {
                $unit->stop();
                $this->getRunStorage()->saveRunUnit($unit);
            }
        }
        return $this->redirect($this->generateUrl('run_show', array('id' => $id)));
    }