Skip to content

Commit

Permalink
Merge pull request #18 from Fahl-Design/dependabot/add-v2-config-file
Browse files Browse the repository at this point in the history
Upgrade to GitHub-native Dependabot
  • Loading branch information
Fahl-Design authored May 1, 2021
2 parents a37ae52 + 6995bed commit 3db1eb1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
24 changes: 16 additions & 8 deletions src/Log4php/Appender/Slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function getDefaultLayout(): \LoggerLayout
public function setLinkNames(bool $linkNames): self
{
$this->getConfig()->set(
Config::KEY_LINK_NAMES, $linkNames
Config::KEY_LINK_NAMES,
$linkNames
);

return $this;
Expand All @@ -78,7 +79,8 @@ public function setLinkNames(bool $linkNames): self
public function setMarkdownInAttachmentsFields(array $fields): self
{
$this->getConfig()->set(
Config::KEY_MARKDOWN_IN_ATTACHMENTS_FIELDS, $fields
Config::KEY_MARKDOWN_IN_ATTACHMENTS_FIELDS,
$fields
);

return $this;
Expand All @@ -94,7 +96,8 @@ public function setMarkdownInAttachmentsFields(array $fields): self
public function setIconByLevel(bool $setIconByLevel): self
{
$this->getConfig()->set(
Config::KEY_SET_ICON_BY_LOG_LEVEL, $setIconByLevel
Config::KEY_SET_ICON_BY_LOG_LEVEL,
$setIconByLevel
);

return $this;
Expand All @@ -110,7 +113,8 @@ public function setIconByLevel(bool $setIconByLevel): self
public function setUnfurlLinks(bool $unfurlLinks): self
{
$this->getConfig()->set(
Config::KEY_UNFURL_LINKS, $unfurlLinks
Config::KEY_UNFURL_LINKS,
$unfurlLinks
);

return $this;
Expand All @@ -126,7 +130,8 @@ public function setUnfurlLinks(bool $unfurlLinks): self
public function setUnfurlMedia(bool $unfurlMedia): self
{
$this->getConfig()->set(
Config::KEY_UNFURL_MEDIA, $unfurlMedia
Config::KEY_UNFURL_MEDIA,
$unfurlMedia
);

return $this;
Expand All @@ -143,7 +148,8 @@ public function setIcon(string $icon): self
{
if (!empty($icon)) {
$this->getConfig()->set(
Config::KEY_ICON, $icon
Config::KEY_ICON,
$icon
);

return $this;
Expand Down Expand Up @@ -234,7 +240,8 @@ public function setAllowMarkdown(bool $allowMarkdown): self
public function setAsAttachment(bool $sendLogAsAttachment): self
{
$this->getConfig()->set(
Config::KEY_AS_ATTACHMENT, $sendLogAsAttachment
Config::KEY_AS_ATTACHMENT,
$sendLogAsAttachment
);

return $this;
Expand All @@ -250,7 +257,8 @@ public function setAsAttachment(bool $sendLogAsAttachment): self
public function setAddLoggerNameToMessage(bool $value): self
{
$this->getConfig()->set(
Config::KEY_ADD_LOGGER_TO_MESSAGE, $value
Config::KEY_ADD_LOGGER_TO_MESSAGE,
$value
);

return $this;
Expand Down
9 changes: 6 additions & 3 deletions src/Log4php/Slack/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ protected function _getSlackApiClient(): SlackApiClient
* @return string
*/
protected function _getMarkdownTitleText(
LogEvent $event, string $logMessage
LogEvent $event,
string $logMessage
): string {
return '*'.$event->getLevel()->toString().'* '
.'_( Logger: *'.$this->_getName().'* )_: '.$logMessage.'';
Expand Down Expand Up @@ -174,7 +175,8 @@ protected function _getSlackApiSettings(): array
* @param null|SlackApiClient $apiClient
*/
public function __construct(
Config $config, SlackApiClient $apiClient = null
Config $config,
SlackApiClient $apiClient = null
) {
$this->_config = $config;
$this->_slackApiClient = $apiClient;
Expand Down Expand Up @@ -276,7 +278,8 @@ protected function _generateAttachment(LogEvent $event): Attachment
* @return Message
*/
protected function _addMessageTitle(
Message $message, LogEvent $event
Message $message,
LogEvent $event
): Message {
$logMessage = $this->_getLogMessage($event);

Expand Down

0 comments on commit 3db1eb1

Please sign in to comment.