Made it to level 6!

This commit is contained in:
James Cole 2025-01-04 15:16:11 +01:00
parent 54d0433dd4
commit 5602715c96
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
35 changed files with 99 additions and 103 deletions

View File

@ -194,7 +194,7 @@ class IndexController extends Controller
return view('accounts.index', compact('objectType', 'inactiveCount', 'subTitleIcon', 'subTitle', 'page', 'accounts'));
}
private function subtract(array $startBalances, array $endBalances)
private function subtract(array $startBalances, array $endBalances): array
{
$result = [];
foreach ($endBalances as $key => $value) {

View File

@ -31,10 +31,11 @@ use FireflyIII\Notifications\Notifiables\OwnerNotifiable;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
class NotificationController extends Controller
{
public function index()
public function index(): View
{
Log::channel('audit')->info('User visits notifications index.');
$title = (string) trans('firefly.administration');

View File

@ -50,7 +50,7 @@ class UnknownUserLoginAttempt extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -109,7 +109,7 @@ class UnknownUserLoginAttempt extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('owner');
}

View File

@ -55,7 +55,7 @@ class UserInvitation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -64,7 +64,7 @@ class UserInvitation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(OwnerNotifiable $notifiable)
public function toMail(OwnerNotifiable $notifiable): MailMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -108,7 +108,7 @@ class UserInvitation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(OwnerNotifiable $notifiable)
public function toSlack(OwnerNotifiable $notifiable): SlackMessage
{
return new SlackMessage()->content(
(string) trans('email.invitation_created_body', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email])
@ -118,7 +118,7 @@ class UserInvitation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('owner');
}

View File

@ -55,7 +55,7 @@ class UserRegistration extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -64,7 +64,7 @@ class UserRegistration extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(OwnerNotifiable $notifiable)
public function toMail(OwnerNotifiable $notifiable): MailMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -107,7 +107,7 @@ class UserRegistration extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(OwnerNotifiable $notifiable)
public function toSlack(OwnerNotifiable $notifiable): SlackMessage
{
return new SlackMessage()->content((string) trans('email.admin_new_user_registered', ['email' => $this->user->email, 'id' => $this->user->id]));
}
@ -115,7 +115,7 @@ class UserRegistration extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('owner');
}

View File

@ -52,7 +52,7 @@ class VersionCheckResult extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -61,7 +61,7 @@ class VersionCheckResult extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(OwnerNotifiable $notifiable)
public function toMail(OwnerNotifiable $notifiable): MailMessage
{
return (new MailMessage())
->markdown('emails.new-version', ['message' => $this->message])
@ -99,7 +99,7 @@ class VersionCheckResult extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(OwnerNotifiable $notifiable)
public function toSlack(OwnerNotifiable $notifiable): SlackMessage
{
return new SlackMessage()->content($this->message)
->attachment(static function ($attachment): void {
@ -111,7 +111,7 @@ class VersionCheckResult extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('owner');
}

View File

@ -55,7 +55,7 @@ class OwnerNotifiable
};
}
public function routeNotificationForPushover()
public function routeNotificationForPushover(): PushoverReceiver
{
Log::debug('Return settings for routeNotificationForPushover');
$pushoverAppToken = (string) app('fireflyconfig')->getEncrypted('pushover_app_token', '')->data;

View File

@ -40,7 +40,7 @@ class ReturnsSettings
throw new FireflyException(sprintf('Cannot handle channel "%s"', $channel));
}
private static function getNtfySettings(string $type, ?User $user)
private static function getNtfySettings(string $type, ?User $user): array
{
$settings = [
'ntfy_server' => 'https://ntfy.sh',

View File

@ -50,7 +50,7 @@ class DisabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -59,7 +59,7 @@ class DisabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.disabled_mfa_subject');
$ip = Request::ip();
@ -94,7 +94,7 @@ class DisabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.disabled_mfa_slack', ['email' => $this->user->email]);
@ -104,7 +104,7 @@ class DisabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -50,7 +50,7 @@ class EnabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -59,7 +59,7 @@ class EnabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.enabled_mfa_subject');
$ip = Request::ip();
@ -94,7 +94,7 @@ class EnabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.enabled_mfa_slack', ['email' => $this->user->email]);
@ -104,7 +104,7 @@ class EnabledMFANotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -52,7 +52,7 @@ class MFABackupFewLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -61,7 +61,7 @@ class MFABackupFewLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.mfa_few_backups_left_subject', ['count' => $this->count]);
$ip = Request::ip();
@ -96,7 +96,7 @@ class MFABackupFewLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.mfa_few_backups_left_slack', ['email' => $this->user->email, 'count' => $this->count]);
@ -106,7 +106,7 @@ class MFABackupFewLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -50,7 +50,7 @@ class MFABackupNoLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -59,7 +59,7 @@ class MFABackupNoLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.mfa_no_backups_left_subject');
$ip = Request::ip();
@ -94,7 +94,7 @@ class MFABackupNoLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.mfa_no_backups_left_slack', ['email' => $this->user->email]);
@ -104,7 +104,7 @@ class MFABackupNoLeftNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -49,7 +49,7 @@ class MFAManyFailedAttemptsNotification extends Notification
$this->count = $count;
}
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -58,7 +58,7 @@ class MFAManyFailedAttemptsNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.mfa_many_failed_subject', ['count' => $this->count]);
$ip = Request::ip();
@ -93,7 +93,7 @@ class MFAManyFailedAttemptsNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.mfa_many_failed_slack', ['email' => $this->user->email, 'count' => $this->count]);
@ -103,7 +103,7 @@ class MFAManyFailedAttemptsNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -50,7 +50,7 @@ class MFAUsedBackupCodeNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -59,7 +59,7 @@ class MFAUsedBackupCodeNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.used_backup_code_subject');
$ip = Request::ip();
@ -94,7 +94,7 @@ class MFAUsedBackupCodeNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.used_backup_code_slack', ['email' => $this->user->email]);
@ -104,7 +104,7 @@ class MFAUsedBackupCodeNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -50,7 +50,7 @@ class NewBackupCodesNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -59,7 +59,7 @@ class NewBackupCodesNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.new_backup_codes_subject');
$ip = Request::ip();
@ -94,7 +94,7 @@ class NewBackupCodesNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.new_backup_codes_slack', ['email' => $this->user->email]);
@ -104,7 +104,7 @@ class NewBackupCodesNotification extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -47,7 +47,7 @@ class UserFailedLoginAttempt extends Notification
$this->user = $user;
}
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -56,7 +56,7 @@ class UserFailedLoginAttempt extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$subject = (string) trans('email.failed_login_subject');
$ip = Request::ip();
@ -91,7 +91,7 @@ class UserFailedLoginAttempt extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$message = (string) trans('email.failed_login_message', ['email' => $this->user->email]);
@ -101,7 +101,7 @@ class UserFailedLoginAttempt extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -39,7 +39,7 @@ class OwnerTestNotificationEmail extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -48,7 +48,7 @@ class OwnerTestNotificationEmail extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(OwnerNotifiable $notifiable)
public function toMail(OwnerNotifiable $notifiable): MailMessage
{
$address = (string) config('firefly.site_owner');
@ -61,7 +61,7 @@ class OwnerTestNotificationEmail extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ['mail'];
}

View File

@ -42,10 +42,8 @@ class OwnerTestNotificationNtfy extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*
* @param mixed $notifiable
*/
public function toArray($notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -69,7 +67,7 @@ class OwnerTestNotificationNtfy extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return [NtfyChannel::class];
}

View File

@ -43,7 +43,7 @@ class OwnerTestNotificationPushover extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -64,7 +64,7 @@ class OwnerTestNotificationPushover extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return [PushoverChannel::class];
}

View File

@ -41,7 +41,7 @@ class OwnerTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(OwnerNotifiable $notifiable)
public function toArray(OwnerNotifiable $notifiable): array
{
return [
];
@ -50,7 +50,7 @@ class OwnerTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(OwnerNotifiable $notifiable)
public function toSlack(OwnerNotifiable $notifiable): SlackMessage
{
return new SlackMessage()->content((string) trans('email.admin_test_subject'));
// return new SlackMessage()->text((string) trans('email.admin_test_subject'))->to($url);
@ -59,7 +59,7 @@ class OwnerTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(OwnerNotifiable $notifiable)
public function via(OwnerNotifiable $notifiable): array
{
return ['slack'];
}

View File

@ -39,13 +39,13 @@ class UserTestNotificationEmail extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
}
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$address = (string) $notifiable->email;
@ -58,7 +58,7 @@ class UserTestNotificationEmail extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ['mail'];
}

View File

@ -43,7 +43,7 @@ class UserTestNotificationNtfy extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -67,7 +67,7 @@ class UserTestNotificationNtfy extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $user)
public function via(User $user): array
{
return [NtfyChannel::class];
}

View File

@ -43,7 +43,7 @@ class UserTestNotificationPushover extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -64,7 +64,7 @@ class UserTestNotificationPushover extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return [PushoverChannel::class];
}

View File

@ -41,7 +41,7 @@ class UserTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $user)
public function toArray(User $user): array
{
return [
];
@ -50,7 +50,7 @@ class UserTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $user)
public function toSlack(User $user): SlackMessage
{
return new SlackMessage()->content((string) trans('email.admin_test_subject'));
// return new SlackMessage()->text((string) trans('email.admin_test_subject'))->to($url);
@ -59,7 +59,7 @@ class UserTestNotificationSlack extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $user)
public function via(User $user): array
{
return ['slack'];
}

View File

@ -56,7 +56,7 @@ class BillReminder extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -65,7 +65,7 @@ class BillReminder extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
->markdown('emails.bill-warning', ['field' => $this->field, 'diff' => $this->diff, 'bill' => $this->bill])
@ -107,7 +107,7 @@ class BillReminder extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$bill = $this->bill;
$url = route('bills.show', [$bill->id]);
@ -124,7 +124,7 @@ class BillReminder extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -45,7 +45,7 @@ class NewAccessToken extends Notification
public function __construct() {}
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -54,7 +54,7 @@ class NewAccessToken extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -91,7 +91,7 @@ class NewAccessToken extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
return new SlackMessage()->content((string) trans('email.access_token_created_body'));
}
@ -99,7 +99,7 @@ class NewAccessToken extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -59,7 +59,7 @@ class RuleActionFailed extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -86,7 +86,7 @@ class RuleActionFailed extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$groupTitle = $this->groupTitle;
$groupLink = $this->groupLink;
@ -103,7 +103,7 @@ class RuleActionFailed extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
$channels = ReturnsAvailableChannels::returnChannels('user', $notifiable);
if (($key = array_search('mail', $channels, true)) !== false) {

View File

@ -46,7 +46,7 @@ class TransactionCreation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -55,7 +55,7 @@ class TransactionCreation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
->markdown('emails.report-new-journals', ['transformed' => $this->collection])
@ -66,7 +66,7 @@ class TransactionCreation extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ['mail'];
}

View File

@ -43,7 +43,7 @@ class UserLogin extends Notification
{
use Queueable;
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -52,7 +52,7 @@ class UserLogin extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -94,7 +94,7 @@ class UserLogin extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -105,7 +105,7 @@ class UserLogin extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -53,7 +53,7 @@ class UserNewPassword extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable)
public function toArray(User $notifiable): array
{
return [
];
@ -62,7 +62,7 @@ class UserNewPassword extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toMail(User $notifiable)
public function toMail(User $notifiable): MailMessage
{
$ip = Request::ip();
$host = Steam::getHostName($ip);
@ -96,12 +96,12 @@ class UserNewPassword extends Notification
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toSlack(User $notifiable)
public function toSlack(User $notifiable): SlackMessage
{
return new SlackMessage()->content((string) trans('email.reset_pw_message'));
}
public function via(User $notifiable)
public function via(User $notifiable): array
{
return ReturnsAvailableChannels::returnChannels('user', $notifiable);
}

View File

@ -117,7 +117,7 @@ class BillDateCalculator
}
}
Log::debug('end of loop');
$simple = $set->map(
$simple = $set->map( // @phpstan-ignore-line
static function (Carbon $date) {
return $date->format('Y-m-d');
}

View File

@ -195,7 +195,7 @@ class Preferences
return $result;
}
public function getEncrypted(string $name, $default = null): ?Preference
public function getEncrypted(string $name, mixed $default = null): ?Preference
{
$result = $this->get($name, $default);
if (null === $result) {

View File

@ -326,7 +326,7 @@ class BillTransformer extends AbstractTransformer
break;
}
}
$simple = $set->map(
$simple = $set->map( // @phpstan-ignore-line
static function (Carbon $date) {
return $date->toAtomString();
}

View File

@ -400,7 +400,7 @@ class User extends Authenticatable
return $this->belongsToMany(Role::class);
}
public function routeNotificationForPushover()
public function routeNotificationForPushover(): PushoverReceiver
{
$appToken = (string) app('preferences')->getEncrypted('pushover_app_token', '')->data;
$userToken = (string) app('preferences')->getEncrypted('pushover_user_token', '')->data;

View File

@ -100,12 +100,9 @@ class FireflyValidator extends Validator
}
/**
* @param mixed $attribute
* @param mixed $value
*
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function validateBic($attribute, $value): bool
public function validateBic(mixed $attribute,mixed $value): bool
{
$regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i';
$result = preg_match($regex, $value);
@ -116,7 +113,7 @@ class FireflyValidator extends Validator
return true;
}
public function validateExistingMfaCode($attribute, $value): bool
public function validateExistingMfaCode(mixed $attribute, mixed $value): bool
{
if (!is_string($value) || 6 !== strlen($value)) {
return false;