From fe9289eda5c5dae39aa29277c7c0d14436a446f3 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Fri, 23 Oct 2015 13:55:04 -0700 Subject: [PATCH] Remove whitespace from empty lines, reformatted inline comments --- PHPCI/Controller/WebhookController.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/PHPCI/Controller/WebhookController.php b/PHPCI/Controller/WebhookController.php index d2f9b694..b43bd1cd 100644 --- a/PHPCI/Controller/WebhookController.php +++ b/PHPCI/Controller/WebhookController.php @@ -85,30 +85,25 @@ class WebhookController extends \b8\Controller public function bitbucket($projectId) { $project = $this->fetchProject($projectId, 'bitbucket'); - - /* - * support both old services and new webhooks - */ - + + // Support both old services and new webhooks if ($payload = $this->getParam('payload')) { return $this->bitbucketService(json_decode($payload, true), $project); } - + $payload = json_decode(file_get_contents("php://input"), true); - + if (empty($payload['push']['changes'])) { - /* - * invalid event from bitbucket - */ + // Invalid event from bitbucket return [ 'status' => 'failed', 'commits' => [] ]; } - + return $this->bitbucketWebhook($payload, $project); } - + /** * Bitbucket webhooks. */ @@ -137,7 +132,7 @@ class WebhookController extends \b8\Controller return array('status' => $status, 'commits' => $results); } - + /** * Bitbucket POST service. */