Fix Laravel Pint formatting

This commit is contained in:
root
2026-06-09 00:03:03 -04:00
parent 8d4d610b82
commit b5fd4a4ca1
1414 changed files with 11317 additions and 10201 deletions
@@ -19,7 +19,7 @@ use Illuminate\Support\Facades\Log;
*/
class PromotionReminderService
{
/** @var (callable(int $userId, string $title, string $body, array $channels):void)|null */
/** @var (callable(int, string, string, array):void)|null */
private $dispatcher;
public function __construct(
@@ -40,7 +40,7 @@ class PromotionReminderService
?string $message = null,
array $channels = ['in_app', 'email']
): PromotionReminderLog {
if (!in_array($reminderType, PromotionReminderLog::ALLOWED_TYPES, true)) {
if (! in_array($reminderType, PromotionReminderLog::ALLOWED_TYPES, true)) {
$reminderType = PromotionReminderLog::TYPE_MANUAL;
}
@@ -53,7 +53,7 @@ class PromotionReminderService
'%s is eligible for promotion to %s.%s Please complete enrollment as soon as possible.',
$studentName ?: 'Your child',
$level,
$deadline ? ' Deadline: ' . $deadline . '.' : ''
$deadline ? ' Deadline: '.$deadline.'.' : ''
);
$finalSubject = $subject ?: $defaultSubject;
@@ -83,7 +83,7 @@ class PromotionReminderService
$this->dispatch((int) $record->parent_id, $finalSubject, $finalMessage, $channels);
}
if (!$record->parent_notified_at) {
if (! $record->parent_notified_at) {
$record->parent_notified_at = now();
$record->save();
$this->audit->logParentNotified($record, $userId, $reminderType);
@@ -118,6 +118,7 @@ class PromotionReminderService
$type = $this->resolveReminderType($record, $now);
if ($type === null) {
$skipped++;
continue;
}
$alreadySent = PromotionReminderLog::query()
@@ -126,6 +127,7 @@ class PromotionReminderService
->exists();
if ($alreadySent) {
$skipped++;
continue;
}
try {
@@ -177,22 +179,24 @@ class PromotionReminderService
if ($elapsedSeconds * 2 >= $totalSeconds) {
return PromotionReminderLog::TYPE_HALFWAY;
}
return PromotionReminderLog::TYPE_FIRST;
}
private function studentName(StudentPromotionRecord $record): ?string
{
$student = Student::query()->find($record->student_id);
if (!$student) {
if (! $student) {
return null;
}
$name = trim((string) ($student->firstname ?? '') . ' ' . (string) ($student->lastname ?? ''));
$name = trim((string) ($student->firstname ?? '').' '.(string) ($student->lastname ?? ''));
return $name !== '' ? $name : null;
}
private function dispatch(int $userId, string $subject, string $message, array $channels): void
{
if (!$this->dispatcher) {
if (! $this->dispatcher) {
return;
}
try {