1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-20 08:06:19 +02:00

Updated position of iconEmoji variable to prevent BC breaks

This commit is contained in:
Derek Clapham
2014-08-22 16:49:42 +10:00
parent c63d082444
commit ff6c458260
2 changed files with 8 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ class SlackHandler extends SocketHandler
* @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($token, $channel, $username = 'Monolog', $iconEmoji = 'alien', $useAttachment = true, $level = Logger::CRITICAL, $bubble = true)
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $level = Logger::CRITICAL, $bubble = true, $iconEmoji = null)
{
if (!extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
@@ -99,7 +99,6 @@ class SlackHandler extends SocketHandler
'token' => $this->token,
'channel' => $this->channel,
'username' => $this->username,
'icon_emoji' => ":{$this->iconEmoji}:",
'text' => '',
'attachments' => array()
);
@@ -128,7 +127,11 @@ class SlackHandler extends SocketHandler
} else {
$dataArray['text'] = $record['message'];
}
if ($this->iconEmoji !== null) {
$dataArray['icon_emoji'] = ":{$this->iconEmoji}:";
}
return http_build_query($dataArray);
}