Fix phpstan issues

This commit is contained in:
James Cole
2025-09-07 07:31:00 +02:00
parent b87b99a755
commit 296a64e284
103 changed files with 605 additions and 617 deletions

View File

@@ -68,20 +68,21 @@ class UnknownUserLoginAttempt extends Notification
;
}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toNtfy(OwnerNotifiable $notifiable): Message
{
$settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
$message = new Message();
$ip = Request::ip();
$message->topic($settings['ntfy_topic']);
$message->title((string) trans('email.unknown_user_subject'));
$message->body((string) trans('email.unknown_user_message', ['address' => $this->address, 'ip' => $ip]));
return $message;
}
// /**
// * @SuppressWarnings("PHPMD.UnusedFormalParameter")
// */
//
// public function toNtfy(OwnerNotifiable $notifiable): Message
// {
// $settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
// $message = new Message();
// $ip = Request::ip();
// $message->topic($settings['ntfy_topic']);
// $message->title((string) trans('email.unknown_user_subject'));
// $message->body((string) trans('email.unknown_user_message', ['address' => $this->address, 'ip' => $ip]));
//
// return $message;
// }
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")

View File

@@ -73,20 +73,20 @@ class UserInvitation extends Notification
;
}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toNtfy(OwnerNotifiable $notifiable): Message
{
Log::debug('Now in toNtfy() for UserInvitation');
$settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
$message = new Message();
$message->topic($settings['ntfy_topic']);
$message->title((string) trans('email.invitation_created_subject'));
$message->body((string) trans('email.invitation_created_body', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email]));
return $message;
}
// /**
// * @SuppressWarnings("PHPMD.UnusedFormalParameter")
// */
// public function toNtfy(OwnerNotifiable $notifiable): Message
// {
// Log::debug('Now in toNtfy() for UserInvitation');
// $settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
// $message = new Message();
// $message->topic($settings['ntfy_topic']);
// $message->title((string) trans('email.invitation_created_subject'));
// $message->body((string) trans('email.invitation_created_body', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email]));
//
// return $message;
// }
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")

View File

@@ -72,20 +72,20 @@ class UserRegistration extends Notification
;
}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toNtfy(OwnerNotifiable $notifiable): Message
{
Log::debug('Now in toNtfy() for (Admin) UserRegistration');
$settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
$message = new Message();
$message->topic($settings['ntfy_topic']);
$message->title((string) trans('email.registered_subject_admin'));
$message->body((string) trans('email.admin_new_user_registered', ['email' => $this->user->email, 'invitee' => $this->user->email]));
return $message;
}
// /**
// * @SuppressWarnings("PHPMD.UnusedFormalParameter")
// */
// public function toNtfy(OwnerNotifiable $notifiable): Message
// {
// Log::debug('Now in toNtfy() for (Admin) UserRegistration');
// $settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
// $message = new Message();
// $message->topic($settings['ntfy_topic']);
// $message->title((string) trans('email.registered_subject_admin'));
// $message->body((string) trans('email.admin_new_user_registered', ['email' => $this->user->email, 'invitee' => $this->user->email]));
//
// return $message;
// }
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")

View File

@@ -64,20 +64,20 @@ class VersionCheckResult extends Notification
;
}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toNtfy(OwnerNotifiable $notifiable): Message
{
Log::debug('Now in toNtfy() for VersionCheckResult');
$settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
$message = new Message();
$message->topic($settings['ntfy_topic']);
$message->title((string) trans('email.new_version_email_subject'));
$message->body($this->message);
return $message;
}
// /**
// * @SuppressWarnings("PHPMD.UnusedFormalParameter")
// */
// public function toNtfy(OwnerNotifiable $notifiable): Message
// {
// Log::debug('Now in toNtfy() for VersionCheckResult');
// $settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
// $message = new Message();
// $message->topic($settings['ntfy_topic']);
// $message->title((string) trans('email.new_version_email_subject'));
// $message->body($this->message);
//
// return $message;
// }
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")