From 9b198a128e495138e0bfed29dba80913b911acb9 Mon Sep 17 00:00:00 2001 From: Vincent Vermeulen Date: Thu, 5 Oct 2017 17:43:33 +0200 Subject: [PATCH] Use function getLatestBuild --- src/PHPCensor/Command/ScheduleBuildCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PHPCensor/Command/ScheduleBuildCommand.php b/src/PHPCensor/Command/ScheduleBuildCommand.php index 5deaa04b..82090ed2 100644 --- a/src/PHPCensor/Command/ScheduleBuildCommand.php +++ b/src/PHPCensor/Command/ScheduleBuildCommand.php @@ -73,7 +73,8 @@ class ScheduleBuildCommand extends Command /** @var Project $project */ foreach ($projects as $project) { - $latestBuild = $this->buildStore->getByProjectId($project->getId(), 1); + $latestBuild = $this->buildStore->getLatestBuilds($project->getId(), 1); + if ($latestBuild['count'] > 0) { /** @var Build $build */ $build = $latestBuild['items'][0];