From 03aeb7e3b1dddeb68a2e8ac1216fba7ca133899f Mon Sep 17 00:00:00 2001 From: Steve B Date: Sat, 7 Dec 2013 14:29:25 +0000 Subject: [PATCH] remove unreachable if --- PHPCI/Builder.php | 6 +++--- PHPCI/Command/PollCommand.php | 2 +- PHPCI/Controller/BitbucketController.php | 2 +- PHPCI/Controller/BuildController.php | 2 +- PHPCI/Controller/GitController.php | 2 +- PHPCI/Controller/GithubController.php | 2 +- PHPCI/Controller/GitlabController.php | 2 +- PHPCI/Controller/ProjectController.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php index 440c0d53..63cf2bad 100644 --- a/PHPCI/Builder.php +++ b/PHPCI/Builder.php @@ -159,7 +159,7 @@ class Builder implements LoggerAwareInterface, BuildLogger public function execute() { // Update the build in the database, ping any external services. - $this->build->setStatus(1); + $this->build->setStatus(Build::STATUS_RUNNING); $this->build->setStarted(new \DateTime()); $this->store->save($this->build); $this->build->sendStatusPostback(); @@ -182,14 +182,14 @@ class Builder implements LoggerAwareInterface, BuildLogger // If we got this far, the build was successful! if ($this->success) { - $this->build->setStatus(2); + $this->build->setStatus(Build::STATUS_SUCCESS); $this->pluginExecutor->executePlugins($this->config, 'success'); $this->logSuccess('BUILD SUCCESSFUL!'); } } catch (\Exception $ex) { $this->logFailure($ex->getMessage(), $ex); - $this->build->setStatus(3); + $this->build->setStatus(Build::STATUS_FAILED); } // Clean up: diff --git a/PHPCI/Command/PollCommand.php b/PHPCI/Command/PollCommand.php index af91acec..3918e27d 100644 --- a/PHPCI/Command/PollCommand.php +++ b/PHPCI/Command/PollCommand.php @@ -84,7 +84,7 @@ class PollCommand extends Command $build = new Build(); $build->setProjectId($project->getId()); $build->setCommitId($last_commit); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setBranch($project->getType() === 'hg' ? 'default' : 'master'); $build->setCreated(new \DateTime()); diff --git a/PHPCI/Controller/BitbucketController.php b/PHPCI/Controller/BitbucketController.php index 9ec4bb39..783421a3 100644 --- a/PHPCI/Controller/BitbucketController.php +++ b/PHPCI/Controller/BitbucketController.php @@ -53,7 +53,7 @@ class BitbucketController extends \PHPCI\Controller $build = new Build(); $build->setProjectId($project); $build->setCommitId($commits[$branch]); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setLog(''); $build->setCreated(new \DateTime()); $build->setBranch($branch); diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php index 8c183774..e7e827d8 100644 --- a/PHPCI/Controller/BuildController.php +++ b/PHPCI/Controller/BuildController.php @@ -109,7 +109,7 @@ class BuildController extends \PHPCI\Controller $build = new Build(); $build->setProjectId($copy->getProjectId()); $build->setCommitId($copy->getCommitId()); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setBranch($copy->getBranch()); $build->setCreated(new \DateTime()); diff --git a/PHPCI/Controller/GitController.php b/PHPCI/Controller/GitController.php index 396ecaa9..b5a6cf87 100644 --- a/PHPCI/Controller/GitController.php +++ b/PHPCI/Controller/GitController.php @@ -47,7 +47,7 @@ class GitController extends \PHPCI\Controller $build->setCommitId($commit); } - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setLog(''); $build->setCreated(new \DateTime()); } catch (\Exception $ex) { diff --git a/PHPCI/Controller/GithubController.php b/PHPCI/Controller/GithubController.php index b616cbb4..4fe99756 100644 --- a/PHPCI/Controller/GithubController.php +++ b/PHPCI/Controller/GithubController.php @@ -48,7 +48,7 @@ class GithubController extends \PHPCI\Controller $build = new Build(); $build->setProjectId($project); $build->setCommitId($payload['after']); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setLog(''); $build->setCreated(new \DateTime()); $build->setBranch(str_replace('refs/heads/', '', $payload['ref'])); diff --git a/PHPCI/Controller/GitlabController.php b/PHPCI/Controller/GitlabController.php index 020b6346..a466f4dd 100644 --- a/PHPCI/Controller/GitlabController.php +++ b/PHPCI/Controller/GitlabController.php @@ -42,7 +42,7 @@ class GitlabController extends \PHPCI\Controller $build = new Build(); $build->setProjectId($project); $build->setCommitId($payload['after']); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setLog(''); $build->setCreated(new \DateTime()); $build->setBranch(str_replace('refs/heads/', '', $payload['ref'])); diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 1a4fc496..7c0b75e7 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -69,7 +69,7 @@ class ProjectController extends \PHPCI\Controller $build = new Build(); $build->setProjectId($projectId); $build->setCommitId('Manual'); - $build->setStatus(0); + $build->setStatus(Build::STATUS_NEW); $build->setBranch($project->getType() === 'hg' ? 'default' : 'master'); $build->setCreated(new \DateTime());