Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 8, 2018
1 parent b978700 commit 0ad73a5
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Monolog/Formatter/ElasticaFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getType(): string

/**
* Convert a log message into an Elastica Document
* @param array $record
* @param array $record
* @return Document
*/
protected function getDocument(array $record): Document
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Formatter/ElasticsearchFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ElasticsearchFormatter extends NormalizerFormatter

/**
* @param string $index Elasticsearch index name
* @param string $type Elasticsearch record type
* @param string $type Elasticsearch record type
*/
public function __construct(string $index, string $type)
{
Expand Down
1 change: 1 addition & 0 deletions src/Monolog/Handler/ElasticaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface
if ($formatter instanceof ElasticaFormatter) {
return parent::setFormatter($formatter);
}

throw new \InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter');
}

Expand Down
3 changes: 2 additions & 1 deletion src/Monolog/Handler/ElasticsearchHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function setFormatter(FormatterInterface $formatter): HandlerInterface
if ($formatter instanceof ElasticsearchFormatter) {
return parent::setFormatter($formatter);
}

throw new InvalidArgumentException('ElasticsearchHandler is only compatible with ElasticsearchFormatter');
}

Expand Down Expand Up @@ -122,7 +123,7 @@ public function handleBatch(array $records): void
/**
* Use Elasticsearch bulk API to send list of documents
*
* @param array $records
* @param array $records
* @throws \RuntimeException
*/
protected function bulkSend(array $records): void
Expand Down
4 changes: 2 additions & 2 deletions src/Monolog/Handler/ZendMonitorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class ZendMonitorHandler extends AbstractProcessingHandler
];

/**
* @param string|int $level The minimum logging level at which this handler will be triggered.
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not.
* @param string|int $level The minimum logging level at which this handler will be triggered.
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not.
* @throws MissingExtensionException
*/
public function __construct($level = Logger::DEBUG, bool $bubble = true)
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Processor/ProcessorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

/*
* This file is part of the Monolog package.
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/ResettableInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

/*
* This file is part of the Monolog package.
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/SignalHandler.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

/*
* This file is part of the Monolog package.
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Utils.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

/*
* This file is part of the Monolog package.
Expand Down
4 changes: 3 additions & 1 deletion tests/Monolog/Formatter/JsonFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public function testFormatWithPrettyPrint()
"channel": "test",
"datetime": "'.$record['datetime']->format('Y-m-d\TH:i:s.uP').'",
"extra": {}
}', $formatter->format($record));
}',
$formatter->format($record)
);

$formatter->setJsonPrettyPrint(false);
$record = $this->getRecord();
Expand Down
1 change: 1 addition & 0 deletions tests/Monolog/Handler/ElasticaHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public function testHandleIntegration()

$client = new Client();
$handler = new ElasticaHandler($client, $this->options);

try {
$handler->handleBatch([$msg]);
} catch (\RuntimeException $e) {
Expand Down
6 changes: 3 additions & 3 deletions tests/Monolog/Handler/ElasticsearchHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testHandle()
],
],
$data,
]
],
];

// setup ES client mock
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testHandleIntegration()
/**
* Return last created document id from ES response
*
* @param array $info Elasticsearch last request info
* @param array $info Elasticsearch last request info
* @return string|null
*/
protected function getCreatedDocId(array $info)
Expand All @@ -255,7 +255,7 @@ protected function getDocSourceFromElastic(Client $client, $index, $type, $docum
$params = [
'index' => $index,
'type' => $type,
'id' => $documentId
'id' => $documentId,
];

$data = $client->get($params);
Expand Down
4 changes: 2 additions & 2 deletions tests/Monolog/Handler/InsightOpsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Monolog\Handler;

use Monolog\Test\TestCase;
use Monolog\Logger;
use Monolog\Logger;

/**
/**
* @author Robert Kaufmann III <[email protected]>
* @author Gabriel Machado <[email protected]>
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Monolog/Handler/RavenHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function testBreadcrumbs()
$this->assertSame('test', $breadcrumbs[1]['category']);
$this->assertSame('info', $breadcrumbs[1]['level']);
$this->assertSame('Step 2: prepare user redirect', $breadcrumbs[1]['message']);

$handler->resetBreadcrumbs();
$handler->handle($this->getRecord(Logger::INFO, 'Hello!'));
$this->assertEmpty($ravenClient->breadcrumbs->fetch());
Expand Down
2 changes: 1 addition & 1 deletion tests/Monolog/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public function testReset()
$assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) {
$that->assertEmpty($getProperty($bufferHandler, 'buffer'));
};
$assertBuffersEmpty = function() use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
$assertBuffersEmpty = function () use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
$assertBufferOfBufferHandlerEmpty();
$that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer'));
};
Expand Down
7 changes: 3 additions & 4 deletions tests/Monolog/SignalHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

/*
* This file is part of the Monolog package.
Expand All @@ -22,7 +22,6 @@
*/
class SignalHandlerTest extends TestCase
{

private $asyncSignalHandling;
private $blockedSignals;
private $signalHandlers;
Expand Down Expand Up @@ -56,7 +55,8 @@ protected function tearDown()
}
}

private function setSignalHandler($signo, $handler = SIG_DFL) {
private function setSignalHandler($signo, $handler = SIG_DFL)
{
if (function_exists('pcntl_signal_get_handler')) {
$this->signalHandlers[$signo] = pcntl_signal_get_handler($signo);
} else {
Expand Down Expand Up @@ -284,5 +284,4 @@ public function asyncProvider()
array(true, true, 1, 1),
);
}

}

0 comments on commit 0ad73a5

Please sign in to comment.