Skip to content

Commit

Permalink
Merge pull request #1 from eustatos/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
eustatos committed Aug 18, 2017
2 parents 936121c + a6b75ca commit 61de0e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
22 changes: 10 additions & 12 deletions Event.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace Eustatos\gitlab\webhook;
namespace Eustatos\gitlab\webhook;

/**
* Event
*
* @package Eustatos\gitlab\webhook
* @author Alexander Astashkin <astashkinav@gmail.com>
*/
/**
* Event
*
* @package Eustatos\gitlab\webhook
* @author Alexander Astashkin <astashkinav@gmail.com>
*/
class Event
{
private $_command;
Expand All @@ -18,8 +18,6 @@ class Event
* __construct
*
* @param string $command
* @param array $output
* @param int $result
* @param string $password
* @access public
* @return void
Expand Down Expand Up @@ -48,8 +46,8 @@ public function getResult()
echo 'Result execution: ' . $this->_command . PHP_EOL
. $this->_result . PHP_EOL;
echo '<pre>';
print_r($this->_output);
echo '</pre>';
print_r($this->_output);
echo '</pre>';
}

/**
Expand Down Expand Up @@ -82,7 +80,7 @@ public function logRequest($file)
$contentType = isset($_SERVER['CONTENT_TYPE'])
? trim($_SERVER['CONTENT_TYPE'])
: '';
if (strcasecmp($contentType, 'application/json') !=0 ) {
if (strcasecmp($contentType, 'application/json') != 0) {
throw new Exception('Content type must be: application/json');
}
$jsonRequest = trim(file_get_contents('php://input'));
Expand Down
12 changes: 6 additions & 6 deletions example.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
require_once('vendor/autoload.php');
require_once('vendor/autoload.php');

$execution = new \Eustatos\gitlab\webhook\Event(
$_REQUEST['command'],
'b2b pushed'
);
$execution->logResult('gitlab-webhook.log');
$execution = new \Eustatos\gitlab\webhook\Event(
$_REQUEST['command'],
'b2b pushed'
);
$execution->logResult('gitlab-webhook.log');

0 comments on commit 61de0e3

Please sign in to comment.