diff options
Diffstat (limited to 'src/Monolog/Handler/Slack/SlackRecord.php')
-rw-r--r-- | src/Monolog/Handler/Slack/SlackRecord.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index 38bc838..d9e6a4c 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); /* * This file is part of the Monolog package. @@ -89,7 +89,7 @@ class SlackRecord { $this->channel = $channel; $this->username = $username; - $this->userIcon = trim($userIcon, ':'); + $this->userIcon = $userIcon !== null ? trim($userIcon, ':') : null; $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; $this->includeContextAndExtra = $includeContextAndExtra; @@ -127,7 +127,7 @@ class SlackRecord 'color' => $this->getAttachmentColor($record['level']), 'fields' => array(), 'mrkdwn_in' => array('fields'), - 'ts' => $record['datetime']->getTimestamp() + 'ts' => $record['datetime']->getTimestamp(), ); if ($this->useShortAttachment) { @@ -137,7 +137,6 @@ class SlackRecord $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); } - if ($this->includeContextAndExtra) { foreach (array('extra', 'context') as $key) { if (empty($record[$key])) { @@ -229,7 +228,7 @@ class SlackRecord /** * Generates attachment field * - * @param string $title + * @param string $title * @param string|array $value\ * * @return array @@ -243,7 +242,7 @@ class SlackRecord return array( 'title' => $title, 'value' => $value, - 'short' => false + 'short' => false, ); } |