Autoformat lol

This commit is contained in:
James Cole
2026-01-23 15:09:50 +01:00
parent ae1347c550
commit 8f15a32bd6
1071 changed files with 21111 additions and 21687 deletions

View File

@@ -1,6 +1,5 @@
<?php
/*
* SubscriptionsOverdueReminder.php
* Copyright (c) 2025 james@firefly-iii.org
@@ -38,15 +37,16 @@ class SubscriptionsOverdueReminder extends Notification
{
use Queueable;
public function __construct(private array $overdue) {}
public function __construct(
private array $overdue
) {}
/**
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
*/
public function toArray(User $notifiable): array
{
return [
];
return [];
}
/**
@@ -58,30 +58,26 @@ class SubscriptionsOverdueReminder extends Notification
$info = [];
$count = 0;
foreach ($this->overdue as $item) {
$current = [
'bill' => $item['bill'],
];
$current['pay_dates'] = array_map(
static fn (string $date): string => new Carbon($date)->isoFormat((string)trans('config.month_and_day_moment_js')),
$item['dates']['pay_dates']
);
$info[] = $current;
$current = ['bill' => $item['bill']];
$current['pay_dates'] = array_map(static fn(string $date): string => new Carbon($date)->isoFormat((string) trans(
'config.month_and_day_moment_js'
)), $item['dates']['pay_dates']);
$info[] = $current;
++$count;
}
return new MailMessage()
->markdown('emails.subscriptions-overdue-warning', ['info' => $info, 'count' => $count])
->subject($this->getSubject())
;
->markdown('emails.subscriptions-overdue-warning', ['info' => $info, 'count' => $count])
->subject($this->getSubject());
}
private function getSubject(): string
{
if (count($this->overdue) > 1) {
return (string)trans('email.subscriptions_overdue_subject_multi', ['count' => count($this->overdue)]);
return (string) trans('email.subscriptions_overdue_subject_multi', ['count' => count($this->overdue)]);
}
return (string)trans('email.subscriptions_overdue_subject_single');
return (string) trans('email.subscriptions_overdue_subject_single');
}
// public function toNtfy(User $notifiable): Message
@@ -100,9 +96,7 @@ class SubscriptionsOverdueReminder extends Notification
*/
public function toPushover(User $notifiable): PushoverMessage
{
return PushoverMessage::create((string)trans('email.bill_warning_please_action'))
->title($this->getSubject())
;
return PushoverMessage::create((string) trans('email.bill_warning_please_action'))->title($this->getSubject());
}
/**
@@ -115,10 +109,9 @@ class SubscriptionsOverdueReminder extends Notification
return new SlackMessage()
->warning()
->attachment(static function ($attachment) use ($url): void {
$attachment->title((string)trans('firefly.visit_bills'), $url);
$attachment->title((string) trans('firefly.visit_bills'), $url);
})
->content($this->getSubject())
;
->content($this->getSubject());
}
/**