mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-21 00:26:10 +02:00
CS fixes & upgrading cs fixer config
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user