Better docblock type hinting for stores.

This commit is contained in:
Dan Cryer 2013-10-08 18:24:20 +01:00
commit d060227fbd
10 changed files with 105 additions and 50 deletions

View file

@ -22,9 +22,14 @@ use PHPCI\Model\Build;
*/
class BuildStatusController extends \PHPCI\Controller
{
/**
* @var \PHPCI\Store\ProjectStore
*/
protected $projectStore;
public function init()
{
$this->_projectStore = Store\Factory::getStore('Project');
$this->projectStore = Store\Factory::getStore('Project');
}
/**
@ -32,9 +37,9 @@ class BuildStatusController extends \PHPCI\Controller
*/
public function image($projectId)
{
$branch = $this->getParam('branch', 'master');
$project = $this->_projectStore->getById($projectId);
$status = 'ok';
$branch = $this->getParam('branch', 'master');
$project = $this->projectStore->getById($projectId);
$status = 'ok';
if (isset($project) && $project instanceof Project) {
$build = $project->getLatestBuild($branch, array(2,3));