php-censor/src/PHPCensor/Model/Build/GogsBuild.php
Dmitry Khomutov 58f1004652
Renamed projects types and build classes: 'remote'/RemoteGitBuild to
'git'/GitBuild, MercurialBuild to HgBuild, SubversionBuild to SvnBuild,
'bitbuckethg' to 'bitbucket-hg'.
2018-02-28 10:02:55 +07:00

37 lines
795 B
PHP

<?php
namespace PHPCensor\Model\Build;
/**
* GogsBuild Build Model
*/
class GogsBuild extends GitBuild
{
/**
* Get link to commit from Gogs repository
*/
public function getCommitLink()
{
return $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
}
/**
* Get link to branch from Gogs repository
*/
public function getBranchLink()
{
return $this->getProject()->getReference() . '/src/' . $this->getBranch();
}
/**
* Get link to specific file (and line) in a the repo's branch
*/
public function getFileLinkTemplate()
{
return sprintf(
'%s/src/%s/{FILE}#L{LINE}',
$this->getProject()->getReference(),
$this->getCommitId()
);
}
}