DNBranchList::getReferences PHP Method

getReferences() protected method

protected getReferences ( ) : array
return array
    protected function getReferences()
    {
        $branches = array();
        // Placeholder to put master branch first
        $firstBranch = null;
        try {
            $repository = new Gitonomy\Git\Repository($this->project->getLocalCVSPath());
        } catch (Exception $e) {
            return $branches;
        }
        foreach ($repository->getReferences()->getBranches() as $branch) {
            /** @var DNBranch $obj */
            $obj = DNBranch::create($branch, $this->project, $this->data);
            if ($branch->getName() == 'master') {
                $firstBranch = array($branch->getName() => $obj);
            } else {
                $branches[$branch->getName()] = $obj;
            }
        }
        if ($firstBranch) {
            $branches = $firstBranch + $branches;
        }
        return $branches;
    }