mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 20:57:36 +02:00
CS fixes
This commit is contained in:
@@ -81,6 +81,7 @@ class ElasticaHandler extends AbstractProcessingHandler
|
|||||||
if ($formatter instanceof ElasticaFormatter) {
|
if ($formatter instanceof ElasticaFormatter) {
|
||||||
return parent::setFormatter($formatter);
|
return parent::setFormatter($formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter');
|
throw new \InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -89,6 +89,7 @@ class ElasticsearchHandler extends AbstractProcessingHandler
|
|||||||
if ($formatter instanceof ElasticsearchFormatter) {
|
if ($formatter instanceof ElasticsearchFormatter) {
|
||||||
return parent::setFormatter($formatter);
|
return parent::setFormatter($formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new InvalidArgumentException('ElasticsearchHandler is only compatible with ElasticsearchFormatter');
|
throw new InvalidArgumentException('ElasticsearchHandler is only compatible with ElasticsearchFormatter');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Monolog package.
|
* This file is part of the Monolog package.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Monolog package.
|
* This file is part of the Monolog package.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Monolog package.
|
* This file is part of the Monolog package.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Monolog package.
|
* This file is part of the Monolog package.
|
||||||
|
@@ -69,7 +69,9 @@ class JsonFormatterTest extends TestCase
|
|||||||
"channel": "test",
|
"channel": "test",
|
||||||
"datetime": "'.$record['datetime']->format('Y-m-d\TH:i:s.uP').'",
|
"datetime": "'.$record['datetime']->format('Y-m-d\TH:i:s.uP').'",
|
||||||
"extra": {}
|
"extra": {}
|
||||||
}', $formatter->format($record));
|
}',
|
||||||
|
$formatter->format($record)
|
||||||
|
);
|
||||||
|
|
||||||
$formatter->setJsonPrettyPrint(false);
|
$formatter->setJsonPrettyPrint(false);
|
||||||
$record = $this->getRecord();
|
$record = $this->getRecord();
|
||||||
|
@@ -183,6 +183,7 @@ class ElasticaHandlerTest extends TestCase
|
|||||||
|
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
$handler = new ElasticaHandler($client, $this->options);
|
$handler = new ElasticaHandler($client, $this->options);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$handler->handleBatch([$msg]);
|
$handler->handleBatch([$msg]);
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
|
@@ -80,7 +80,7 @@ class ElasticsearchHandlerTest extends TestCase
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
$data,
|
$data,
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
// setup ES client mock
|
// setup ES client mock
|
||||||
@@ -255,7 +255,7 @@ class ElasticsearchHandlerTest extends TestCase
|
|||||||
$params = [
|
$params = [
|
||||||
'index' => $index,
|
'index' => $index,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'id' => $documentId
|
'id' => $documentId,
|
||||||
];
|
];
|
||||||
|
|
||||||
$data = $client->get($params);
|
$data = $client->get($params);
|
||||||
|
@@ -12,9 +12,9 @@
|
|||||||
namespace Monolog\Handler;
|
namespace Monolog\Handler;
|
||||||
|
|
||||||
use Monolog\Test\TestCase;
|
use Monolog\Test\TestCase;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Robert Kaufmann III <rok3@rok3.me>
|
* @author Robert Kaufmann III <rok3@rok3.me>
|
||||||
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
|
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
|
||||||
*/
|
*/
|
||||||
|
@@ -666,7 +666,7 @@ class LoggerTest extends \PHPUnit\Framework\TestCase
|
|||||||
$assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) {
|
$assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) {
|
||||||
$that->assertEmpty($getProperty($bufferHandler, 'buffer'));
|
$that->assertEmpty($getProperty($bufferHandler, 'buffer'));
|
||||||
};
|
};
|
||||||
$assertBuffersEmpty = function() use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
|
$assertBuffersEmpty = function () use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
|
||||||
$assertBufferOfBufferHandlerEmpty();
|
$assertBufferOfBufferHandlerEmpty();
|
||||||
$that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer'));
|
$that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer'));
|
||||||
};
|
};
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Monolog package.
|
* This file is part of the Monolog package.
|
||||||
@@ -22,7 +22,6 @@ use Monolog\Test\TestCase;
|
|||||||
*/
|
*/
|
||||||
class SignalHandlerTest extends TestCase
|
class SignalHandlerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
private $asyncSignalHandling;
|
private $asyncSignalHandling;
|
||||||
private $blockedSignals;
|
private $blockedSignals;
|
||||||
private $signalHandlers;
|
private $signalHandlers;
|
||||||
@@ -56,7 +55,8 @@ class SignalHandlerTest extends TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setSignalHandler($signo, $handler = SIG_DFL) {
|
private function setSignalHandler($signo, $handler = SIG_DFL)
|
||||||
|
{
|
||||||
if (function_exists('pcntl_signal_get_handler')) {
|
if (function_exists('pcntl_signal_get_handler')) {
|
||||||
$this->signalHandlers[$signo] = pcntl_signal_get_handler($signo);
|
$this->signalHandlers[$signo] = pcntl_signal_get_handler($signo);
|
||||||
} else {
|
} else {
|
||||||
@@ -284,5 +284,4 @@ class SignalHandlerTest extends TestCase
|
|||||||
array(true, true, 1, 1),
|
array(true, true, 1, 1),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user