protected function createBuild(
        Project $project,
        $commitId,
        $branch,
        $committer,
        $commitMessage,
        bool $rebuild = false,
        array $extra = null
    ) {
        // Check if a build already exists for this commit ID when not rebuilding:
        if (!$rebuild) {
            $builds = $this->buildStore->getByProjectAndCommit($project->getId(), $commitId);

            if ($builds['count']) {
                return array(
                    'status' => 'ignored',
                    'message' => sprintf('Duplicate of build #%d', $builds['items'][0]->getId())
                );
            }
        }

        // If not, create a new build job for it:
        $build = $this->buildService->createBuild($project, $commitId, $branch, $committer, $commitMessage, $extra);

        return array('status' => 'ok', 'buildID' => $build->getID());
    }
protected function createBuild(
        Project $project,
        $commitId,
        $branch,
        $committer,
        $commitMessage,
        bool $rebuild = false,
        array $extra = null
    ) {
        // Check if a build already exists for this commit ID when not rebuilding:
        if (!$rebuild) {
            $builds = $this->buildStore->getByProjectAndCommit($project->getId(), $commitId);

            if ($builds['count']) {
                return array(
                    'status' => 'ignored',
                    'message' => sprintf('Duplicate of build #%d', $builds['items'][0]->getId())
                );
            }
        }

        // If not, create a new build job for it:
        $build = $this->buildService->createBuild($project, $commitId, $branch, $committer, $commitMessage, $extra);

        return array('status' => 'ok', 'buildID' => $build->getID());
    }
protected function createBuild ( Project $ project , $ commitId , $ branch , $ committer , $ commitMessage , bool $ rebuild = false , array $ extra = null ) { // Check if a build already exists for this commit ID when not rebuilding: if ( ! $ rebuild ) { $ builds = $ this -> buildStore -> getByProjectAndCommit ( $ project -> getId ( ) , $ commitId ) ; if ( $ builds [ 'count' ] ) { return array ( 'status' => 'ignored' , 'message' => sprintf ( 'Duplicate of build #%d' , $ builds [ 'items' ] [ 0 ] -> getId ( ) ) ) ; } } // If not, create a new build job for it: $ build = $ this -> buildService -> createBuild ( $ project , $ commitId , $ branch , $ committer , $ commitMessage , $ extra ) ; return array ( 'status' => 'ok' , 'buildID' => $ build -> getID ( ) ) ; }
Wrapper for creating a new build.

@param Project $project
@param string $commitId
@param string $branch
@param string $committer
@param string $commitMessage
@param bool $rebuild
@param array $extra

@return array

@throws Exception
Wrapper for creating a new build .