mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
CS fixes
This commit is contained in:
@@ -24,15 +24,15 @@ class CouchDBHandler extends AbstractProcessingHandler
|
||||
{
|
||||
private $options;
|
||||
|
||||
public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
||||
public function __construct(array $options = [], $level = Logger::DEBUG, $bubble = true)
|
||||
{
|
||||
$this->options = array_merge(array(
|
||||
$this->options = array_merge([
|
||||
'host' => 'localhost',
|
||||
'port' => 5984,
|
||||
'dbname' => 'logger',
|
||||
'username' => null,
|
||||
'password' => null,
|
||||
), $options);
|
||||
], $options);
|
||||
|
||||
parent::__construct($level, $bubble);
|
||||
}
|
||||
@@ -48,15 +48,15 @@ class CouchDBHandler extends AbstractProcessingHandler
|
||||
}
|
||||
|
||||
$url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];
|
||||
$context = stream_context_create(array(
|
||||
'http' => array(
|
||||
$context = stream_context_create([
|
||||
'http' => [
|
||||
'method' => 'POST',
|
||||
'content' => $record['formatted'],
|
||||
'ignore_errors' => true,
|
||||
'max_redirects' => 0,
|
||||
'header' => 'Content-type: application/json',
|
||||
),
|
||||
));
|
||||
],
|
||||
]);
|
||||
|
||||
if (false === @file_get_contents($url, null, $context)) {
|
||||
throw new \RuntimeException(sprintf('Could not connect to %s', $url));
|
||||
|
||||
Reference in New Issue
Block a user