Cleaning up unnecessary use of 'die' and 'exit'
This commit is contained in:
parent
84b00e305e
commit
2d5659d613
13 changed files with 188 additions and 106 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue