More PHP8.4 updates

This commit is contained in:
James Cole
2025-05-04 13:47:00 +02:00
parent e42107c03c
commit 51e86448c7
195 changed files with 524 additions and 715 deletions

View File

@@ -42,15 +42,8 @@ class BillReminder extends Notification
{
use Queueable;
private Bill $bill;
private int $diff;
private string $field;
public function __construct(Bill $bill, string $field, int $diff)
public function __construct(private Bill $bill, private string $field, private int $diff)
{
$this->bill = $bill;
$this->field = $field;
$this->diff = $diff;
}
/**
@@ -67,7 +60,7 @@ class BillReminder extends Notification
*/
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
return new MailMessage()
->markdown('emails.bill-warning', ['field' => $this->field, 'diff' => $this->diff, 'bill' => $this->bill])
->subject($this->getSubject())
;

View File

@@ -62,7 +62,7 @@ class NewAccessToken extends Notification
$userAgent = Request::userAgent();
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
return (new MailMessage())
return new MailMessage()
->markdown('emails.token-created', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
->subject((string) trans('email.access_token_created_subject'))
;

View File

@@ -36,11 +36,8 @@ class TransactionCreation extends Notification
{
use Queueable;
private array $collection;
public function __construct(array $collection)
public function __construct(private array $collection)
{
$this->collection = $collection;
}
/**
@@ -57,7 +54,7 @@ class TransactionCreation extends Notification
*/
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
return new MailMessage()
->markdown('emails.report-new-journals', ['transformed' => $this->collection])
->subject(trans_choice('email.new_journals_subject', count($this->collection)))
;

View File

@@ -59,7 +59,7 @@ class UserLogin extends Notification
$userAgent = Request::userAgent();
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
return (new MailMessage())
return new MailMessage()
->markdown('emails.new-ip', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
->subject((string) trans('email.login_from_new_ip'))
;

View File

@@ -43,11 +43,8 @@ class UserNewPassword extends Notification
{
use Queueable;
private string $url;
public function __construct(string $url)
public function __construct(private string $url)
{
$this->url = $url;
}
/**
@@ -69,7 +66,7 @@ class UserNewPassword extends Notification
$userAgent = Request::userAgent();
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
return (new MailMessage())
return new MailMessage()
->markdown('emails.password', ['url' => $this->url, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
->subject((string) trans('email.reset_pw_subject'))
;

View File

@@ -52,7 +52,7 @@ class UserRegistration extends Notification
*/
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
return new MailMessage()
->markdown('emails.registered', ['address' => route('index')])
->subject((string) trans('email.registered_subject'))
;