forked from php-censor/php-censor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGogsBuild.php
More file actions
40 lines (36 loc) · 904 Bytes
/
Copy pathGogsBuild.php
File metadata and controls
40 lines (36 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace PHPCensor\Model\Build;
/**
* GogsBuild Build Model
*/
class GogsBuild extends RemoteGitBuild
{
/**
* Get link to commit from Gogs repository
*/
public function getCommitLink()
{
if ($this->getCommitId() !== 'manual'){
return $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
}
return parent::getCommitLink();
}
/**
* 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()
);
}
}