Cleaning up unnecessary use of 'die' and 'exit'

This commit is contained in:
Dan Cryer 2015-02-12 12:37:56 +00:00
commit 2d5659d613
13 changed files with 188 additions and 106 deletions

View file

@ -53,7 +53,7 @@ class BuildStatusController extends \PHPCI\Controller
$status = 'passing';
if (!$project->getAllowPublicStatus()) {
die();
return null;
}
if (isset($project) && $project instanceof Project) {
@ -76,6 +76,13 @@ class BuildStatusController extends \PHPCI\Controller
public function image($projectId)
{
$status = $this->getStatus($projectId);
if (is_null($status)) {
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', '/');
return $response;
}
$color = ($status == 'passing') ? 'green' : 'red';
header('Content-Type: image/svg+xml');