mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 19:57:41 +02:00
CS fixes
This commit is contained in:
@@ -141,8 +141,8 @@ abstract class AbstractHandler implements HandlerInterface
|
|||||||
/**
|
/**
|
||||||
* Sets the bubbling behavior.
|
* Sets the bubbling behavior.
|
||||||
*
|
*
|
||||||
* @param Boolean $bubble true means that this handler allows bubbling.
|
* @param Boolean $bubble true means that this handler allows bubbling.
|
||||||
* false means that bubbling is not permitted.
|
* false means that bubbling is not permitted.
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setBubble($bubble)
|
public function setBubble($bubble)
|
||||||
|
@@ -32,8 +32,8 @@ class CubeHandler extends AbstractProcessingHandler
|
|||||||
* Create a Cube handler
|
* Create a Cube handler
|
||||||
*
|
*
|
||||||
* @throws UnexpectedValueException when given url is not a valid url.
|
* @throws UnexpectedValueException when given url is not a valid url.
|
||||||
* A valid url must consists of three parts : protocol://host:port
|
* A valid url must consists of three parts : protocol://host:port
|
||||||
* Only valid protocol used by Cube are http and udp
|
* Only valid protocol used by Cube are http and udp
|
||||||
*/
|
*/
|
||||||
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
|
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
|
||||||
{
|
{
|
||||||
|
@@ -75,7 +75,7 @@ class DynamoDbHandler extends AbstractProcessingHandler
|
|||||||
*/
|
*/
|
||||||
protected function filterEmptyFields(array $record)
|
protected function filterEmptyFields(array $record)
|
||||||
{
|
{
|
||||||
return array_filter($record, function($value) {
|
return array_filter($record, function ($value) {
|
||||||
return !empty($value) || false === $value || 0 === $value;
|
return !empty($value) || false === $value || 0 === $value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ interface HandlerInterface
|
|||||||
*
|
*
|
||||||
* @param array $record The record to handle
|
* @param array $record The record to handle
|
||||||
* @return Boolean true means that this handler handled the record, and that bubbling is not permitted.
|
* @return Boolean true means that this handler handled the record, and that bubbling is not permitted.
|
||||||
* false means the record was either not processed or that this handler allows bubbling.
|
* false means the record was either not processed or that this handler allows bubbling.
|
||||||
*/
|
*/
|
||||||
public function handle(array $record);
|
public function handle(array $record);
|
||||||
|
|
||||||
|
@@ -32,19 +32,19 @@ class PushoverHandler extends SocketHandler
|
|||||||
private $emergencyLevel;
|
private $emergencyLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $token Pushover api token
|
* @param string $token Pushover api token
|
||||||
* @param string|array $users Pushover user id or array of ids the message will be sent to
|
* @param string|array $users Pushover user id or array of ids the message will be sent to
|
||||||
* @param string $title Title sent to the Pushover API
|
* @param string $title Title sent to the Pushover API
|
||||||
* @param integer $level The minimum logging level at which this handler will be triggered
|
* @param integer $level The minimum logging level at which this handler will be triggered
|
||||||
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
||||||
* @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
|
* @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
|
||||||
* the pushover.net app owner. OpenSSL is required for this option.
|
* the pushover.net app owner. OpenSSL is required for this option.
|
||||||
* @param integer $highPriorityLevel The minimum logging level at which this handler will start
|
* @param integer $highPriorityLevel The minimum logging level at which this handler will start
|
||||||
* sending "high priority" requests to the Pushover API
|
* sending "high priority" requests to the Pushover API
|
||||||
* @param integer $emergencyLevel The minimum logging level at which this handler will start
|
* @param integer $emergencyLevel The minimum logging level at which this handler will start
|
||||||
* sending "emergency" requests to the Pushover API
|
* sending "emergency" requests to the Pushover API
|
||||||
* @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
|
* @param integer $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
|
||||||
* @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
|
* @param integer $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
|
||||||
*/
|
*/
|
||||||
public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
|
public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
|
||||||
{
|
{
|
||||||
|
@@ -69,7 +69,7 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
$level = $this->level;
|
$level = $this->level;
|
||||||
|
|
||||||
// filter records based on their level
|
// filter records based on their level
|
||||||
$records = array_filter($records, function($record) use ($level) {
|
$records = array_filter($records, function ($record) use ($level) {
|
||||||
return $record['level'] >= $level;
|
return $record['level'] >= $level;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the record with the highest severity is the "main" one
|
// the record with the highest severity is the "main" one
|
||||||
$record = array_reduce($records, function($highest, $record) {
|
$record = array_reduce($records, function ($highest, $record) {
|
||||||
if ($record['level'] >= $highest['level']) {
|
if ($record['level'] >= $highest['level']) {
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ class RotatingFileHandler extends StreamHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sorting the files by name to remove the older ones
|
// Sorting the files by name to remove the older ones
|
||||||
usort($logFiles, function($a, $b) {
|
usort($logFiles, function ($a, $b) {
|
||||||
return strcmp($b, $a);
|
return strcmp($b, $a);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -129,9 +129,9 @@ class Logger implements LoggerInterface
|
|||||||
protected $processors;
|
protected $processors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name The logging channel
|
* @param string $name The logging channel
|
||||||
* @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
|
* @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
|
||||||
* @param callable[] $processors Optional array of processors
|
* @param callable[] $processors Optional array of processors
|
||||||
*/
|
*/
|
||||||
public function __construct($name, array $handlers = array(), array $processors = array())
|
public function __construct($name, array $handlers = array(), array $processors = array())
|
||||||
{
|
{
|
||||||
|
@@ -30,7 +30,7 @@ class IntrospectionProcessor
|
|||||||
|
|
||||||
private $skipClassesPartials;
|
private $skipClassesPartials;
|
||||||
|
|
||||||
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\'))
|
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array('Monolog\\'))
|
||||||
{
|
{
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
$this->skipClassesPartials = $skipClassesPartials;
|
$this->skipClassesPartials = $skipClassesPartials;
|
||||||
@@ -56,18 +56,15 @@ class IntrospectionProcessor
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while (isset($trace[$i]['class']))
|
while (isset($trace[$i]['class'])) {
|
||||||
{
|
foreach ($this->skipClassesPartials as $part) {
|
||||||
foreach ($this->skipClassesPartials as $part)
|
if (strpos($trace[$i]['class'], $part) !== false) {
|
||||||
{
|
|
||||||
if (strpos($trace[$i]['class'], $part) !== false)
|
|
||||||
{
|
|
||||||
$i++;
|
$i++;
|
||||||
continue 2;
|
continue 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we should have the call source now
|
// we should have the call source now
|
||||||
$record['extra'] = array_merge(
|
$record['extra'] = array_merge(
|
||||||
|
Reference in New Issue
Block a user