mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Code cleanup.
This commit is contained in:
@@ -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'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user