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

@@ -41,8 +41,6 @@ class TestNotification extends Notification
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(string $address)
{
@@ -53,6 +51,7 @@ class TestNotification extends Notification
* Get the array representation of the notification.
*
* @param mixed $notifiable
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return array
@@ -60,7 +59,6 @@ class TestNotification extends Notification
public function toArray($notifiable)
{
return [
//
];
}
@@ -68,6 +66,7 @@ class TestNotification extends Notification
* Get the mail representation of the notification.
*
* @param mixed $notifiable
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return MailMessage
@@ -76,13 +75,15 @@ class TestNotification extends Notification
{
return (new MailMessage())
->markdown('emails.admin-test', ['email' => $this->address])
->subject((string)trans('email.admin_test_subject'));
->subject((string)trans('email.admin_test_subject'))
;
}
/**
* Get the Slack representation of the notification.
*
* @param mixed $notifiable
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return SlackMessage
@@ -94,6 +95,7 @@ class TestNotification extends Notification
/**
* Get the notification's delivery channels.
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @param mixed $notifiable
@@ -106,6 +108,7 @@ class TestNotification extends Notification
if (UrlValidator::isValidWebhookURL($slackUrl)) {
return ['mail', 'slack'];
}
return ['mail'];
}
}

View File

@@ -42,8 +42,6 @@ class UserInvitation extends Notification
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(InvitedUser $invitee)
{
@@ -56,12 +54,12 @@ class UserInvitation extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toArray($notifiable)
{
return [
//
];
}
@@ -71,13 +69,15 @@ class UserInvitation extends Notification
* @param mixed $notifiable
*
* @return MailMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toMail($notifiable)
{
return (new MailMessage())
->markdown('emails.invitation-created', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email])
->subject((string)trans('email.invitation_created_subject'));
->subject((string)trans('email.invitation_created_subject'))
;
}
/**
@@ -86,6 +86,7 @@ class UserInvitation extends Notification
* @param mixed $notifiable
*
* @return SlackMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toSlack($notifiable)
@@ -101,6 +102,7 @@ class UserInvitation extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function via($notifiable)
@@ -109,6 +111,7 @@ class UserInvitation extends Notification
if (UrlValidator::isValidWebhookURL($slackUrl)) {
return ['mail', 'slack'];
}
return ['mail'];
}
}

View File

@@ -42,8 +42,6 @@ class UserRegistration extends Notification
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(User $user)
{
@@ -56,12 +54,12 @@ class UserRegistration extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toArray($notifiable)
{
return [
//
];
}
@@ -71,13 +69,15 @@ class UserRegistration extends Notification
* @param mixed $notifiable
*
* @return MailMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toMail($notifiable)
{
return (new MailMessage())
->markdown('emails.registered-admin', ['email' => $this->user->email, 'id' => $this->user->id])
->subject((string)trans('email.registered_subject_admin'));
->subject((string)trans('email.registered_subject_admin'))
;
}
/**
@@ -86,6 +86,7 @@ class UserRegistration extends Notification
* @param mixed $notifiable
*
* @return SlackMessage
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function toSlack($notifiable)
@@ -99,6 +100,7 @@ class UserRegistration extends Notification
* @param mixed $notifiable
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function via($notifiable)
@@ -107,6 +109,7 @@ class UserRegistration extends Notification
if (UrlValidator::isValidWebhookURL($slackUrl)) {
return ['mail', 'slack'];
}
return ['mail'];
}
}

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'];
}
}