1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

CS fixes & upgrading cs fixer config

This commit is contained in:
Jordi Boggiano
2015-11-18 17:09:41 +00:00
parent 75ca9e5dc7
commit c889fb2648
64 changed files with 288 additions and 218 deletions

View File

@@ -32,7 +32,6 @@ namespace Monolog\Formatter;
*
* @author Andrius Putna <fordnox@gmail.com>
*/
class FluentdFormatter implements FormatterInterface
{
/**
@@ -46,7 +45,7 @@ class FluentdFormatter implements FormatterInterface
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
}
$this->levelTag = (bool)$levelTag;
$this->levelTag = (bool) $levelTag;
}
public function isUsingLevelsInTag()
@@ -63,7 +62,7 @@ class FluentdFormatter implements FormatterInterface
$message = array(
'message' => $record['message'],
'extra' => $record['extra']
'extra' => $record['extra'],
);
if (!$this->levelTag) {
@@ -86,6 +85,7 @@ class FluentdFormatter implements FormatterInterface
foreach ($records as $record) {
$message .= $this->format($record);
}
return $message;
}
}

View File

@@ -64,8 +64,8 @@ class HtmlFormatter extends NormalizerFormatter
/**
* Create a HTML h1 tag
*
* @param string $title Text to be in the h1
* @param integer $level Error level
* @param string $title Text to be in the h1
* @param int $level Error level
* @return string
*/
private function addTitle($title, $level)
@@ -74,6 +74,7 @@ class HtmlFormatter extends NormalizerFormatter
return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
}
/**
* Formats a log record.
*

View File

@@ -22,7 +22,7 @@ class LogglyFormatter extends JsonFormatter
* Overrides the default batch mode to new lines for compatibility with the
* Loggly bulk API.
*
* @param integer $batchMode
* @param int $batchMode
*/
public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false)
{

View File

@@ -45,16 +45,16 @@ class LogstashFormatter extends NormalizerFormatter
protected $contextPrefix;
/**
* @var integer logstash format version to use
* @var int logstash format version to use
*/
protected $version;
/**
* @param string $applicationName the application that sends the data, used as the "type" field of logstash
* @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
* @param string $extraPrefix prefix for extra keys inside logstash "fields"
* @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_
* @param integer $version the logstash format version to use, defaults to 0
* @param string $applicationName the application that sends the data, used as the "type" field of logstash
* @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
* @param string $extraPrefix prefix for extra keys inside logstash "fields"
* @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_
* @param int $version the logstash format version to use, defaults to 0
*/
public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0)
{
@@ -92,7 +92,7 @@ class LogstashFormatter extends NormalizerFormatter
$message = array(
'@timestamp' => $record['datetime'],
'@source' => $this->systemName,
'@fields' => array()
'@fields' => array(),
);
if (isset($record['message'])) {
$message['@message'] = $record['message'];

View File

@@ -165,8 +165,8 @@ class NormalizerFormatter implements FormatterInterface
/**
* Throws an exception according to a given code with a customized message
*
* @param int $code return code of json_last_error function
* @param mixed $data data that was meant to be encoded
* @param int $code return code of json_last_error function
* @param mixed $data data that was meant to be encoded
* @throws \RuntimeException
*/
private function throwEncodeError($code, $data)

View File

@@ -32,7 +32,7 @@ abstract class AbstractHandler implements HandlerInterface
protected $processors = array();
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($level = Logger::DEBUG, $bubble = true)
@@ -118,7 +118,7 @@ abstract class AbstractHandler implements HandlerInterface
/**
* Sets minimum logging level at which this handler will be triggered.
*
* @param integer $level
* @param int $level
* @return self
*/
public function setLevel($level)
@@ -131,7 +131,7 @@ abstract class AbstractHandler implements HandlerInterface
/**
* Gets minimum logging level at which this handler will be triggered.
*
* @return integer
* @return int
*/
public function getLevel()
{

View File

@@ -54,7 +54,7 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler
/**
* @param mixed $facility
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)

View File

@@ -70,7 +70,7 @@ class AmqpHandler extends AbstractProcessingHandler
0,
array(
'delivery_mode' => 2,
'Content-type' => 'application/json'
'Content-type' => 'application/json',
)
);
} else {
@@ -79,7 +79,7 @@ class AmqpHandler extends AbstractProcessingHandler
(string) $data,
array(
'delivery_mode' => 2,
'content_type' => 'application/json'
'content_type' => 'application/json',
)
),
$this->exchangeName,

View File

@@ -31,7 +31,6 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
* Example of formatted string:
*
* You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}
*
*/
protected function getDefaultFormatter()
{

View File

@@ -32,8 +32,8 @@ class BufferHandler extends AbstractHandler
/**
* @param HandlerInterface $handler Handler.
* @param integer $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
* @param int $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 $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
*/

View File

@@ -51,7 +51,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
protected static $sendHeaders = true;
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($level = Logger::DEBUG, $bubble = true)

View File

@@ -54,7 +54,7 @@ class CouchDBHandler extends AbstractProcessingHandler
'ignore_errors' => true,
'max_redirects' => 0,
'header' => 'Content-type: application/json',
)
),
));
if (false === @file_get_contents($url, null, $context)) {

View File

@@ -32,8 +32,8 @@ class CubeHandler extends AbstractProcessingHandler
* Create a Cube handler
*
* @throws \UnexpectedValueException when given url is not a valid url.
* A valid url must consist of three parts : protocol://host:port
* Only valid protocols used by Cube are http and udp
* A valid url must consist of three parts : protocol://host:port
* Only valid protocols used by Cube are http and udp
*/
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
{
@@ -59,7 +59,7 @@ class CubeHandler extends AbstractProcessingHandler
/**
* Establish a connection to an UDP socket
*
* @throws \LogicException when unable to connect to the socket
* @throws \LogicException when unable to connect to the socket
* @throws MissingExtensionException when there is no socket extension
*/
protected function connectUdp()
@@ -142,9 +142,9 @@ class CubeHandler extends AbstractProcessingHandler
curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');
curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen('['.$data.']'))
);
'Content-Type: application/json',
'Content-Length: ' . strlen('['.$data.']'),
));
Curl\Util::execute($this->httpConnection, 5, false);
}

View File

@@ -26,7 +26,7 @@ class Util
/**
* Executes a CURL request with optional retries and exception on failure
*
* @param resource $ch curl handler
* @param resource $ch curl handler
* @throws \RuntimeException
*/
public static function execute($ch, $retries = 5, $closeAfterDone = true)

View File

@@ -39,8 +39,8 @@ class DynamoDbHandler extends AbstractProcessingHandler
/**
* @param DynamoDbClient $client
* @param string $table
* @param integer $level
* @param boolean $bubble
* @param int $level
* @param bool $bubble
*/
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
{
@@ -64,7 +64,7 @@ class DynamoDbHandler extends AbstractProcessingHandler
$this->client->putItem(array(
'TableName' => $this->table,
'Item' => $formatted
'Item' => $formatted,
));
}

View File

@@ -48,7 +48,7 @@ class ElasticSearchHandler extends AbstractProcessingHandler
/**
* @param Client $client Elastica Client object
* @param array $options Handler configuration
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)

View File

@@ -28,8 +28,8 @@ class ErrorLogHandler extends AbstractProcessingHandler
protected $expandNewlines;
/**
* @param integer $messageType Says where the error should go.
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $messageType Says where the error should go.
* @param int $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 $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
*/

View File

@@ -2,12 +2,12 @@
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler\FingersCrossed;

View File

@@ -118,7 +118,7 @@ class FleepHookHandler extends SocketHandler
private function buildContent($record)
{
$dataArray = array(
'message' => $record['formatted']
'message' => $record['formatted'],
);
return http_build_query($dataArray);

View File

@@ -33,8 +33,8 @@ class GelfHandler extends AbstractProcessingHandler
/**
* @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object
* @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 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
*/
public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
{

View File

@@ -84,16 +84,16 @@ class HipChatHandler extends SocketHandler
private $version;
/**
* @param string $token HipChat API Token
* @param string $room The room that should be alerted of the message (Id or Name)
* @param string $name Name used in the "from" field. Not used for v2
* @param bool $notify Trigger a notification in clients or not
* @param 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 bool $useSSL Whether to connect via SSL.
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
* @param string $host The HipChat server hostname.
* @param string $version The HipChat API version (default HipChatHandler::API_V1)
* @param string $token HipChat API Token
* @param string $room The room that should be alerted of the message (Id or Name)
* @param string $name Name used in the "from" field. Not used for v2
* @param bool $notify Trigger a notification in clients or not
* @param 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 bool $useSSL Whether to connect via SSL.
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
* @param string $host The HipChat server hostname.
* @param string $version The HipChat API version (default HipChatHandler::API_V1)
*/
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
{
@@ -179,7 +179,7 @@ class HipChatHandler extends SocketHandler
/**
* Assigns a color to each level of log records.
*
* @param integer $level
* @param int $level
* @return string
*/
protected function getAlertColor($level)
@@ -303,7 +303,7 @@ class HipChatHandler extends SocketHandler
array(
'level' => $level,
'level_name' => $levelName,
'datetime' => $datetime
'datetime' => $datetime,
)
);
}

View File

@@ -30,10 +30,10 @@ class IFTTTHandler extends AbstractProcessingHandler
private $secretKey;
/**
* @param string $eventName The name of the IFTTT Maker event that should be triggered
* @param string $secretKey A valid IFTTT secret key
* @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 string $eventName The name of the IFTTT Maker event that should be triggered
* @param string $secretKey A valid IFTTT secret key
* @param int $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
*/
public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true)
{
@@ -51,7 +51,7 @@ class IFTTTHandler extends AbstractProcessingHandler
$postData = array(
"value1" => $record["channel"],
"value2" => $record["level_name"],
"value3" => $record["message"]
"value3" => $record["message"],
);
$postString = json_encode($postData);
@@ -61,7 +61,7 @@ class IFTTTHandler extends AbstractProcessingHandler
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json"
"Content-Type: application/json",
));
Curl\Util::execute($ch);

View File

@@ -24,10 +24,10 @@ class LogEntriesHandler extends SocketHandler
protected $logToken;
/**
* @param string $token Log token supplied by LogEntries
* @param boolean $useSSL Whether or not SSL encryption should be used.
* @param int $level The minimum logging level to trigger this handler
* @param boolean $bubble Whether or not messages that are handled should bubble up the stack.
* @param string $token Log token supplied by LogEntries
* @param bool $useSSL Whether or not SSL encryption should be used.
* @param int $level The minimum logging level to trigger this handler
* @param bool $bubble Whether or not messages that are handled should bubble up the stack.
*
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
*/

View File

@@ -26,7 +26,7 @@ class MandrillHandler extends MailHandler
/**
* @param string $apiKey A valid Mandrill API key
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)

View File

@@ -47,7 +47,7 @@ class NativeMailerHandler extends MailHandler
/**
* The wordwrap length for the message
* @var integer
* @var int
*/
protected $maxColumnWidth;
@@ -67,8 +67,8 @@ class NativeMailerHandler extends MailHandler
* @param string|array $to The receiver of the mail
* @param string $subject The subject of the mail
* @param string $from The sender of the mail
* @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 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 int $maxColumnWidth The maximum column width that the message lines will have
*/
public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
@@ -101,7 +101,7 @@ class NativeMailerHandler extends MailHandler
/**
* Add parameters to the message
*
* @param string|array $parameters Custom added parameters
* @param string|array $parameters Custom added parameters
* @return self
*/
public function addParameter($parameters)

View File

@@ -41,16 +41,16 @@ class NewRelicHandler extends AbstractProcessingHandler
* Some context and extra data is passed into the handler as arrays of values. Do we send them as is
* (useful if we are using the API), or explode them for display on the NewRelic RPM website?
*
* @var boolean
* @var bool
*/
protected $explodeArrays;
/**
* {@inheritDoc}
*
* @param string $appName
* @param boolean $explodeArrays
* @param string $transactionName
* @param string $appName
* @param bool $explodeArrays
* @param string $transactionName
*/
public function __construct(
$level = Logger::ERROR,

View File

@@ -24,7 +24,7 @@ use Monolog\Logger;
class NullHandler extends AbstractHandler
{
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $level The minimum logging level at which this handler will be triggered
*/
public function __construct($level = Logger::DEBUG)
{

View File

@@ -66,10 +66,10 @@ class PHPConsoleHandler extends AbstractProcessingHandler
private $connector;
/**
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
* @param int $level
* @param bool $bubble
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
* @param int $level
* @param bool $bubble
* @throws Exception
*/
public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true)

View File

@@ -68,16 +68,16 @@ class PushoverHandler extends SocketHandler
* @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 $title Title sent to the Pushover API
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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 $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.
* @param integer $highPriorityLevel The minimum logging level at which this handler will start
* @param int $highPriorityLevel The minimum logging level at which this handler will start
* sending "high priority" requests to the Pushover API
* @param integer $emergencyLevel The minimum logging level at which this handler will start
* @param int $emergencyLevel The minimum logging level at which this handler will start
* 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 $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
* @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
* @param int $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)
{
@@ -115,7 +115,7 @@ class PushoverHandler extends SocketHandler
'user' => $this->user,
'message' => $message,
'title' => $this->title,
'timestamp' => $timestamp
'timestamp' => $timestamp,
);
if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) {
@@ -176,7 +176,7 @@ class PushoverHandler extends SocketHandler
/**
* Use the formatted message?
* @param boolean $value
* @param bool $value
*/
public function useFormattedMessage($value)
{

View File

@@ -50,7 +50,7 @@ class RavenHandler extends AbstractProcessingHandler
/**
* @param Raven_Client $ravenClient
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)

View File

@@ -34,9 +34,9 @@ class RedisHandler extends AbstractProcessingHandler
/**
* @param \Predis\Client|\Redis $redis The redis instance
* @param string $key The key name to push records to
* @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 integer $capSize Number of entries to limit list size to
* @param 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 int $capSize Number of entries to limit list size to
*/
public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false)
{
@@ -67,7 +67,7 @@ class RedisHandler extends AbstractProcessingHandler
* Write and cap the collection
* Writes the record to the redis list and caps its
*
* @param array $record associative record array
* @param array $record associative record array
* @return void
*/
protected function writeCapped(array $record)

View File

@@ -38,8 +38,8 @@ class RollbarHandler extends AbstractProcessingHandler
/**
* @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token
* @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 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
*/
public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true)
{

View File

@@ -33,8 +33,8 @@ class RotatingFileHandler extends StreamHandler
/**
* @param string $filename
* @param integer $maxFiles The maximal amount of files to keep (0 means unlimited)
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $maxFiles The maximal amount of files to keep (0 means unlimited)
* @param int $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 int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param Boolean $useLocking Try to lock log file before doing any writes

View File

@@ -70,16 +70,16 @@ class SlackHandler extends SocketHandler
private $lineFormatter;
/**
* @param string $token Slack API token
* @param string $channel Slack channel (encoded ID or name)
* @param string $username Name of a bot
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
* @param string|null $iconEmoji The emoji name to use (or null)
* @param 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 bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
* @throws MissingExtensionException If no OpenSSL PHP extension configured
* @param string $token Slack API token
* @param string $channel Slack channel (encoded ID or name)
* @param string $username Name of a bot
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
* @param string|null $iconEmoji The emoji name to use (or null)
* @param 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 bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
* @throws MissingExtensionException If no OpenSSL PHP extension configured
*/
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
{
@@ -140,14 +140,14 @@ class SlackHandler extends SocketHandler
'channel' => $this->channel,
'username' => $this->username,
'text' => '',
'attachments' => array()
'attachments' => array(),
);
if ($this->useAttachment) {
$attachment = array(
'fallback' => $record['message'],
'color' => $this->getAttachmentColor($record['level']),
'fields' => array()
'fields' => array(),
);
if ($this->useShortAttachment) {
@@ -159,7 +159,7 @@ class SlackHandler extends SocketHandler
$attachment['fields'][] = array(
'title' => 'Level',
'value' => $record['level_name'],
'short' => true
'short' => true,
);
}
@@ -169,7 +169,7 @@ class SlackHandler extends SocketHandler
$attachment['fields'][] = array(
'title' => "Extra",
'value' => $this->stringify($record['extra']),
'short' => $this->useShortAttachment
'short' => $this->useShortAttachment,
);
} else {
// Add all extra fields as individual fields in attachment
@@ -177,7 +177,7 @@ class SlackHandler extends SocketHandler
$attachment['fields'][] = array(
'title' => $var,
'value' => $val,
'short' => $this->useShortAttachment
'short' => $this->useShortAttachment,
);
}
}
@@ -188,7 +188,7 @@ class SlackHandler extends SocketHandler
$attachment['fields'][] = array(
'title' => "Context",
'value' => $this->stringify($record['context']),
'short' => $this->useShortAttachment
'short' => $this->useShortAttachment,
);
} else {
// Add all context fields as individual fields in attachment
@@ -196,7 +196,7 @@ class SlackHandler extends SocketHandler
$attachment['fields'][] = array(
'title' => $var,
'value' => $val,
'short' => $this->useShortAttachment
'short' => $this->useShortAttachment,
);
}
}
@@ -267,8 +267,7 @@ class SlackHandler extends SocketHandler
/**
* Stringifies an array of key/value pairs to be used in attachment fields
*
* @param array $fields
* @access protected
* @param array $fields
* @return string
*/
protected function stringify($fields)

View File

@@ -33,7 +33,7 @@ class SocketHandler extends AbstractProcessingHandler
/**
* @param string $connectionString Socket connection string
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
@@ -82,7 +82,7 @@ class SocketHandler extends AbstractProcessingHandler
/**
* Set socket connection to nbe persistent. It only has effect before the connection is initiated.
*
* @param boolean $persistent
* @param bool $persistent
*/
public function setPersistent($persistent)
{
@@ -118,8 +118,7 @@ class SocketHandler extends AbstractProcessingHandler
/**
* Set writing timeout. Only has effect during connection in the writing cycle.
*
* @param float $seconds 0 for no timeout
*
* @param float $seconds 0 for no timeout
*/
public function setWritingTimeout($seconds)
{
@@ -140,7 +139,7 @@ class SocketHandler extends AbstractProcessingHandler
/**
* Get persistent setting
*
* @return boolean
* @return bool
*/
public function isPersistent()
{
@@ -182,7 +181,7 @@ class SocketHandler extends AbstractProcessingHandler
*
* UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
*
* @return boolean
* @return bool
*/
public function isConnected()
{
@@ -329,6 +328,7 @@ class SocketHandler extends AbstractProcessingHandler
if ((time() - $this->lastWritingAt) >= $writingTimeout) {
$this->closeSocket();
return true;
}

View File

@@ -31,7 +31,7 @@ class StreamHandler extends AbstractProcessingHandler
/**
* @param resource|string $stream
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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 int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param Boolean $useLocking Try to lock log file before doing any writes

View File

@@ -26,7 +26,7 @@ class SwiftMailerHandler extends MailHandler
/**
* @param \Swift_Mailer $mailer The mailer to use
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
@@ -48,8 +48,8 @@ class SwiftMailerHandler extends MailHandler
/**
* Creates instance of Swift_Message to be sent
*
* @param string $content formatted email body to be sent
* @param array $records Log records that formed the content
* @param string $content formatted email body to be sent
* @param array $records Log records that formed the content
* @return \Swift_Message
*/
protected function buildMessage($content, array $records)

View File

@@ -34,7 +34,7 @@ class SyslogHandler extends AbstractSyslogHandler
/**
* @param string $ident
* @param mixed $facility
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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 int $logopts Option flags for the openlog() call, defaults to LOG_PID
*/

View File

@@ -27,7 +27,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
* @param string $host
* @param int $port
* @param mixed $facility
* @param integer $level The minimum logging level at which this handler will be triggered
* @param int $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
*/
public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)

View File

@@ -156,7 +156,7 @@ class Logger implements LoggerInterface
/**
* Pushes a handler on to the stack.
*
* @param HandlerInterface $handler
* @param HandlerInterface $handler
* @return $this
*/
public function pushHandler(HandlerInterface $handler)
@@ -185,7 +185,7 @@ class Logger implements LoggerInterface
*
* If a map is passed, keys will be ignored.
*
* @param HandlerInterface[] $handlers
* @param HandlerInterface[] $handlers
* @return $this
*/
public function setHandlers(array $handlers)
@@ -209,7 +209,7 @@ class Logger implements LoggerInterface
/**
* Adds a processor on to the stack.
*
* @param callable $callback
* @param callable $callback
* @return $this
*/
public function pushProcessor($callback)
@@ -244,7 +244,6 @@ class Logger implements LoggerInterface
return $this->processors;
}
/**
* Control the use of microsecond resolution timestamps in the 'datetime'
* member of new records.
@@ -260,13 +259,13 @@ class Logger implements LoggerInterface
*/
public function useMicrosecondTimestamps($micro)
{
$this->microsecondTimestamps = (bool)$micro;
$this->microsecondTimestamps = (bool) $micro;
}
/**
* Adds a log record.
*
* @param integer $level The logging level
* @param int $level The logging level
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
@@ -433,7 +432,7 @@ class Logger implements LoggerInterface
/**
* Gets the name of the logging level.
*
* @param integer $level
* @param int $level
* @return string
*/
public static function getLevelName($level)
@@ -463,7 +462,7 @@ class Logger implements LoggerInterface
/**
* Checks whether the Logger has a handler that listens on the given level
*
* @param integer $level
* @param int $level
* @return Boolean
*/
public function isHandling($level)

View File

@@ -19,18 +19,18 @@ namespace Monolog\Processor;
abstract class MemoryProcessor
{
/**
* @var boolean If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
*/
protected $realUsage;
/**
* @var boolean If true, then format memory size to human readable string (MB, KB, B depending on size)
* @var bool If true, then format memory size to human readable string (MB, KB, B depending on size)
*/
protected $useFormatting;
/**
* @param boolean $realUsage Set this to true to get the real size of memory allocated from system.
* @param boolean $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
* @param bool $realUsage Set this to true to get the real size of memory allocated from system.
* @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
*/
public function __construct($realUsage = true, $useFormatting = true)
{

View File

@@ -49,7 +49,7 @@ class Registry
*
* @param Logger $logger Instance of the logging channel
* @param string|null $name Name of the logging channel ($logger->getName() by default)
* @param boolean $overwrite Overwrite instance in the registry if the given name already exists?
* @param bool $overwrite Overwrite instance in the registry if the given name already exists?
* @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
*/
public static function addLogger(Logger $logger, $name = null, $overwrite = false)
@@ -107,8 +107,8 @@ class Registry
* Gets Logger instance from the registry
*
* @param string $name Name of the requested Logger instance
* @return Logger Requested instance of Logger
* @throws \InvalidArgumentException If named Logger instance is not in the registry
* @return Logger Requested instance of Logger
*/
public static function getInstance($name)
{
@@ -124,8 +124,8 @@ class Registry
*
* @param string $name Name of the requested Logger instance
* @param array $arguments Arguments passed to static method call
* @return Logger Requested instance of Logger
* @throws \InvalidArgumentException If named Logger instance is not in the registry
* @return Logger Requested instance of Logger
*/
public static function __callStatic($name, $arguments)
{