Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -32,7 +32,6 @@ use Illuminate\Notifications\Notification;
/**
* Class VersionCheckResult
*
*/
class VersionCheckResult extends Notification
{
@@ -42,8 +41,6 @@ class VersionCheckResult extends Notification
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(string $message)
{
@@ -56,12 +53,12 @@ class VersionCheckResult extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toArray($notifiable)
{
return [
//
];
}
@@ -71,13 +68,15 @@ class VersionCheckResult extends Notification
* @param mixed $notifiable
*
* @return MailMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toMail($notifiable)
{
return (new MailMessage())
->markdown('emails.new-version', ['message' => $this->message])
->subject((string)trans('email.new_version_email_subject'));
->subject((string)trans('email.new_version_email_subject'))
;
}
/**
@@ -86,14 +85,16 @@ class VersionCheckResult extends Notification
* @param mixed $notifiable
*
* @return SlackMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toSlack($notifiable)
{
return (new SlackMessage())->content($this->message)
->attachment(static function ($attachment) {
$attachment->title('Firefly III @ GitHub', 'https://github.com/firefly-iii/firefly-iii/releases');
});
->attachment(static function ($attachment) {
$attachment->title('Firefly III @ GitHub', 'https://github.com/firefly-iii/firefly-iii/releases');
})
;
}
/**
@@ -102,6 +103,7 @@ class VersionCheckResult extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function via($notifiable)
@@ -110,6 +112,7 @@ class VersionCheckResult extends Notification
if (UrlValidator::isValidWebhookURL($slackUrl)) {
return ['mail', 'slack'];
}
return ['mail'];
}
}