From 9e428a4da67c08850eee19aaa4719736b4a01d24 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Fri, 23 Feb 2018 23:05:06 +0700 Subject: [PATCH] Small fixes. --- src/PHPCensor/Controller/WebhookController.php | 1 - src/PHPCensor/Helper/Bitbucket.php | 6 ++++-- src/PHPCensor/Model/Build/BitbucketBuild.php | 1 - src/PHPCensor/View.php | 2 +- src/PHPCensor/View/layout.phtml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PHPCensor/Controller/WebhookController.php b/src/PHPCensor/Controller/WebhookController.php index 8221c2a0..65a8a900 100644 --- a/src/PHPCensor/Controller/WebhookController.php +++ b/src/PHPCensor/Controller/WebhookController.php @@ -164,7 +164,6 @@ class WebhookController extends Controller return ['status' => 'ok']; } - $headers = []; $username = Config::getInstance()->get('php-censor.bitbucket.username'); $appPassword = Config::getInstance()->get('php-censor.bitbucket.app_password'); diff --git a/src/PHPCensor/Helper/Bitbucket.php b/src/PHPCensor/Helper/Bitbucket.php index e585816b..a6fe475c 100644 --- a/src/PHPCensor/Helper/Bitbucket.php +++ b/src/PHPCensor/Helper/Bitbucket.php @@ -33,7 +33,8 @@ class Bitbucket $url = '/1.0/repositories/' . $repo . '/pullrequests/' . $pullId . '/comments/'; $client = new Client(['base_uri' => 'https://api.bitbucket.org']); - $response = $client->post($url, [ + + $client->post($url, [ 'auth' => [$username, $appPassword], 'headers' => [ 'Content-Type' => 'application/json', @@ -69,7 +70,8 @@ class Bitbucket $url = '/1.0/repositories/' . $repo . '/changesets/' . $commitId . '/comments'; $client = new Client(['base_uri' => 'https://api.bitbucket.org']); - $response = $client->post($url, [ + + $client->post($url, [ 'auth' => [$username, $appPassword], 'headers' => [ 'Content-Type' => 'application/json', diff --git a/src/PHPCensor/Model/Build/BitbucketBuild.php b/src/PHPCensor/Model/Build/BitbucketBuild.php index b2ec12ff..2e84802f 100644 --- a/src/PHPCensor/Model/Build/BitbucketBuild.php +++ b/src/PHPCensor/Model/Build/BitbucketBuild.php @@ -257,7 +257,6 @@ class BitbucketBuild extends RemoteGitBuild false ); - //$file = $builder->buildPath.'test.php'; if ($allowCommentCommit || $allowCommentPullRequest) { $diffLineNumber = $this->getDiffLineNumber($builder, $file, $lineStart); diff --git a/src/PHPCensor/View.php b/src/PHPCensor/View.php index fe2fc428..dcb4cb38 100644 --- a/src/PHPCensor/View.php +++ b/src/PHPCensor/View.php @@ -80,7 +80,7 @@ class View /** * @return boolean */ - protected function LoginIsDisabled() + protected function loginIsDisabled() { $config = Config::getInstance(); $disableAuth = (boolean)$config->get('php-censor.security.disable_auth', false); diff --git a/src/PHPCensor/View/layout.phtml b/src/PHPCensor/View/layout.phtml index 02b9e92d..60d650ae 100644 --- a/src/PHPCensor/View/layout.phtml +++ b/src/PHPCensor/View/layout.phtml @@ -93,7 +93,7 @@ $user = $this->getUser(); - LoginIsDisabled()): ?> + loginIsDisabled()): ?>