From 9f6aff9699413eca60a6aa1e5d64dc40e5e1e640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 00:20:21 +0200 Subject: [PATCH] [GitlabCommitsBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/GitlabCommitsBridge.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bridges/GitlabCommitsBridge.php b/bridges/GitlabCommitsBridge.php index 93328ed5..f5fe97e2 100644 --- a/bridges/GitlabCommitsBridge.php +++ b/bridges/GitlabCommitsBridge.php @@ -26,16 +26,11 @@ class GitlabCommitsBridge extends BridgeAbstract{ )); public function collectData(){ - $uri = $this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p').'/commits/'; - if($this->getInput('b')){ - $uri.=$this->getInput('b'); - }else{ - $uri.='master'; - } + $uri = $this->getInput('uri').'/'.$this->getInput('u').'/' + .$this->getInput('p').'/commits/'.$this->getInput('b'); $html = $this->getSimpleHTMLDOM($uri) - or $this->returnServerError('No results for Gitlab Commits of project '.$this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p')); - + or $this->returnServerError('No results for Gitlab Commits of project '.$uri); foreach($html->find('li.commit') as $commit){