REBELinBLUE\Deployer\Project::getBranchUrlAttribute PHP Method

getBranchUrlAttribute() public method

Gets the HTTP URL to the branch.
See also: Project::accessDetails()
public getBranchUrlAttribute ( string $alternative = null ) : string | false
$alternative string
return string | false
    public function getBranchUrlAttribute($alternative = null)
    {
        $info = $this->accessDetails();
        if (isset($info['domain']) && isset($info['reference'])) {
            $path = 'tree';
            if (preg_match('/bitbucket/', $info['domain'])) {
                $path = 'commits/branch';
            }
            $branch = is_null($alternative) ? $this->branch : $alternative;
            return 'http://' . $info['domain'] . '/' . $info['reference'] . '/' . $path . '/' . $branch;
        }
        return false;
    }