mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup.
This commit is contained in:
@@ -45,8 +45,6 @@ class RuleActionFailed extends Notification
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $params)
|
||||
{
|
||||
@@ -56,8 +54,6 @@ class RuleActionFailed extends Notification
|
||||
$this->groupLink = $groupLink;
|
||||
$this->ruleTitle = $ruleTitle;
|
||||
$this->ruleLink = $ruleLink;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,12 +62,12 @@ class RuleActionFailed extends Notification
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
@@ -81,6 +77,7 @@ class RuleActionFailed extends Notification
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@@ -103,11 +100,12 @@ class RuleActionFailed extends Notification
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
/** @var User|null $user */
|
||||
/** @var null|User $user */
|
||||
$user = auth()->user();
|
||||
$slackUrl = null === $user ? '' : app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (is_array($slackUrl)) {
|
||||
@@ -115,9 +113,11 @@ class RuleActionFailed extends Notification
|
||||
}
|
||||
if (UrlValidator::isValidWebhookURL((string)$slackUrl)) {
|
||||
app('log')->debug('Will send ruleActionFailed through Slack!');
|
||||
|
||||
return ['slack'];
|
||||
}
|
||||
app('log')->debug('Will NOT send ruleActionFailed through Slack');
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user