1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-19 23:56:17 +02:00

Merge remote-tracking branch 'EspadaV8/add-fluent-setters-for-slack-handler'

This commit is contained in:
Jordi Boggiano
2019-07-06 13:46:59 +02:00
2 changed files with 146 additions and 19 deletions

View File

@@ -174,4 +174,59 @@ class SlackHandler extends SocketHandler
return $formatter;
}
/**
* Channel used by the bot when posting
*/
public function setChannel(string $channel): self
{
$this->slackRecord->setChannel($channel);
return $this;
}
/**
* Username used by the bot when posting
*/
public function setUsername(string $username): self
{
$this->slackRecord->setUsername($username);
return $this;
}
public function useAttachment(bool $useAttachment): self
{
$this->slackRecord->useAttachment($useAttachment);
return $this;
}
public function setIconEmoji(string $iconEmoji): self
{
$this->slackRecord->setUserIcon($iconEmoji);
return $this;
}
public function useShortAttachment(bool $useShortAttachment): self
{
$this->slackRecord->useShortAttachment($useShortAttachment);
return $this;
}
public function includeContextAndExtra(bool $includeContextAndExtra): self
{
$this->slackRecord->includeContextAndExtra($includeContextAndExtra);
return $this;
}
public function excludeFields(array $excludeFields): self
{
$this->slackRecord->excludeFields($excludeFields);
return $this;
}
}