From 9f8a5df8108b0fc75a9bbddeb9c12bdeb6aea860 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Feb 2017 08:59:01 +0000 Subject: [PATCH] add getFileLinkTemplate for gogs --- src/PHPCensor/Model/Build/GogsBuild.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/PHPCensor/Model/Build/GogsBuild.php b/src/PHPCensor/Model/Build/GogsBuild.php index c9b463a0..a5f08413 100644 --- a/src/PHPCensor/Model/Build/GogsBuild.php +++ b/src/PHPCensor/Model/Build/GogsBuild.php @@ -26,4 +26,15 @@ class GogsBuild extends RemoteGitBuild { 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() + ); + } }