1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-21 08:36:33 +02:00
This commit is contained in:
Jordi Boggiano
2016-05-26 20:54:06 +01:00
parent 85e43a5e7b
commit f200e79879
115 changed files with 1138 additions and 1123 deletions

View File

@@ -53,12 +53,12 @@ class GitProcessor
$branches = `git branch -v --no-abbrev`;
if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
return self::$cache = array(
return self::$cache = [
'branch' => $matches[1],
'commit' => $matches[2],
);
];
}
return self::$cache = array();
return self::$cache = [];
}
}

View File

@@ -32,15 +32,15 @@ class IntrospectionProcessor
private $skipStackFramesCount;
private $skipFunctions = array(
private $skipFunctions = [
'call_user_func',
'call_user_func_array',
);
];
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array(), $skipStackFramesCount = 0)
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = [], $skipStackFramesCount = 0)
{
$this->level = Logger::toMonologLevel($level);
$this->skipClassesPartials = array_merge(array('Monolog\\'), $skipClassesPartials);
$this->skipClassesPartials = array_merge(['Monolog\\'], $skipClassesPartials);
$this->skipStackFramesCount = $skipStackFramesCount;
}
@@ -85,12 +85,12 @@ class IntrospectionProcessor
// we should have the call source now
$record['extra'] = array_merge(
$record['extra'],
array(
[
'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null,
'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null,
'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null,
'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null,
)
]
);
return $record;

View File

@@ -30,7 +30,7 @@ class PsrLogMessageProcessor
return $record;
}
$replacements = array();
$replacements = [];
foreach ($record['context'] as $key => $val) {
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
$replacements['{'.$key.'}'] = $val;

View File

@@ -20,17 +20,17 @@ class TagProcessor
{
private $tags;
public function __construct(array $tags = array())
public function __construct(array $tags = [])
{
$this->setTags($tags);
}
public function addTags(array $tags = array())
public function addTags(array $tags = [])
{
$this->tags = array_merge($this->tags, $tags);
}
public function setTags(array $tags = array())
public function setTags(array $tags = [])
{
$this->tags = $tags;
}

View File

@@ -30,13 +30,13 @@ class WebProcessor
*
* @var array
*/
protected $extraFields = array(
protected $extraFields = [
'url' => 'REQUEST_URI',
'ip' => 'REMOTE_ADDR',
'http_method' => 'REQUEST_METHOD',
'server' => 'SERVER_NAME',
'referrer' => 'HTTP_REFERER',
);
];
/**
* @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data