diff --git a/PHPCI/BuildFactory.php b/PHPCI/BuildFactory.php index 1dbc4017..91e618a8 100644 --- a/PHPCI/BuildFactory.php +++ b/PHPCI/BuildFactory.php @@ -66,6 +66,8 @@ class BuildFactory case 'svn': $type = 'SubversionBuild'; break; + default: + return $build; } $class = '\\PHPCI\\Model\\Build\\' . $type; diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php index be7f4a8a..9374b763 100644 --- a/PHPCI/Model/Build.php +++ b/PHPCI/Model/Build.php @@ -30,6 +30,11 @@ class Build extends BuildBase public $currentBuildPath = null; + /** + * @var \PHPCI\Model\Project $project + */ + protected $project; + /** * Get link to commit from another source (i.e. Github) */ @@ -249,4 +254,25 @@ class Build extends BuildBase exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath)); } + + /** + * @param Project $value + */ + public function setProjectObject(\PHPCI\Model\Project $value) + { + $this->project = $value; + return parent::setProjectObject($value); + } + + /** + * Get the Project model for this Build by Id. + */ + public function getProject() + { + if (empty($this->project)) { + $this->project = parent::getProject(); + } + + return $this->project; + } } diff --git a/composer.lock b/composer.lock index 0fc6a092..b399ce10 100644 --- a/composer.lock +++ b/composer.lock @@ -1781,16 +1781,16 @@ }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "23af31f402993cfd94e99cbc4b782e9a78eb0e97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23af31f402993cfd94e99cbc4b782e9a78eb0e97", + "reference": "23af31f402993cfd94e99cbc4b782e9a78eb0e97", "shasum": "" }, "require": { @@ -1828,7 +1828,7 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-06-21 15:11:22" }, { "name": "sebastian/recursion-context",