Code cleanup

This commit is contained in:
James Cole
2024-12-22 08:43:12 +01:00
parent 5751f7e5a3
commit 565bd87959
574 changed files with 4600 additions and 4604 deletions

View File

@@ -65,23 +65,6 @@ class RuleActionFailed extends Notification
];
}
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toSlack(User $notifiable)
{
$groupTitle = $this->groupTitle;
$groupLink = $this->groupLink;
$ruleTitle = $this->ruleTitle;
$ruleLink = $this->ruleLink;
return new SlackMessage()->content($this->message)->attachment(static function ($attachment) use ($groupTitle, $groupLink): void {
$attachment->title((string) trans('rules.inspect_transaction', ['title' => $groupTitle]), $groupLink);
})->attachment(static function ($attachment) use ($ruleTitle, $ruleLink): void {
$attachment->title((string) trans('rules.inspect_rule', ['title' => $ruleTitle]), $ruleLink);
});
}
public function toNtfy(User $notifiable): Message
{
$settings = ReturnsSettings::getSettings('ntfy', 'user', $notifiable);
@@ -100,6 +83,23 @@ class RuleActionFailed extends Notification
return PushoverMessage::create($this->message);
}
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toSlack(User $notifiable)
{
$groupTitle = $this->groupTitle;
$groupLink = $this->groupLink;
$ruleTitle = $this->ruleTitle;
$ruleLink = $this->ruleLink;
return new SlackMessage()->content($this->message)->attachment(static function ($attachment) use ($groupTitle, $groupLink): void {
$attachment->title((string) trans('rules.inspect_transaction', ['title' => $groupTitle]), $groupLink);
})->attachment(static function ($attachment) use ($ruleTitle, $ruleLink): void {
$attachment->title((string) trans('rules.inspect_rule', ['title' => $ruleTitle]), $ruleLink);
});
}
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/