Fix Laravel Pint formatting

This commit is contained in:
root
2026-06-08 23:30:22 -04:00
parent 567dc24649
commit c792b8be05
1288 changed files with 10766 additions and 9669 deletions
@@ -13,8 +13,7 @@ class SchoolCalendarNotificationService
public function __construct(
private EmailService $emailService,
private ApplicationUrlService $urls,
) {
}
) {}
public function notify(array $event, array $targets): array
{
@@ -27,7 +26,7 @@ class SchoolCalendarNotificationService
$results = [];
foreach ($targets as $group => $enabled) {
if (!$enabled) {
if (! $enabled) {
continue;
}
@@ -35,12 +34,13 @@ class SchoolCalendarNotificationService
if (empty($emails)) {
Log::warning("SchoolCalendar: no recipient emails for {$group}.");
$results[$group] = null;
continue;
}
$to = $emails[0] ?? '';
$ok = $this->emailService->send($to, $subject, $body, 'general', [], $emails);
if (!$ok) {
if (! $ok) {
Log::warning("SchoolCalendar: failed to send calendar notification to {$group}.");
}
$results[$group] = $ok;
@@ -52,8 +52,9 @@ class SchoolCalendarNotificationService
private function buildSubject(array $event): string
{
$title = trim((string) ($event['title'] ?? 'School Calendar Update'));
$typeSegment = !empty($event['event_type']) ? ' (' . $event['event_type'] . ')' : '';
return 'School Calendar: ' . $title . $typeSegment;
$typeSegment = ! empty($event['event_type']) ? ' ('.$event['event_type'].')' : '';
return 'School Calendar: '.$title.$typeSegment;
}
private function buildBody(array $event): string
@@ -63,12 +64,12 @@ class SchoolCalendarNotificationService
$date = (string) ($event['date'] ?? '');
$description = trim((string) ($event['description'] ?? ''));
$body = '<h3>' . e($title) . '</h3>';
$body .= '<p><strong>Date:</strong> ' . e($date) . '</p>';
$body = '<h3>'.e($title).'</h3>';
$body .= '<p><strong>Date:</strong> '.e($date).'</p>';
if ($description !== '') {
$body .= '<p>' . nl2br(e($description)) . '</p>';
$body .= '<p>'.nl2br(e($description)).'</p>';
}
$body .= '<p><a href="' . e($calendarUrl) . '">View calendar</a></p>';
$body .= '<p><a href="'.e($calendarUrl).'">View calendar</a></p>';
return $body;
}
@@ -88,18 +89,19 @@ class SchoolCalendarNotificationService
$emails = [];
foreach ($rows as $row) {
$email = trim((string) ($row['email'] ?? ''));
if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
if ($email === '' || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
continue;
}
$emails[$email] = true;
}
return array_values(array_keys($emails));
}
private function fetchAdminRows(): array
{
$excluded = ['guest', 'teacher', 'teacher_assistant', 'parent'];
$escaped = array_map(static fn ($value) => "'" . addslashes($value) . "'", $excluded);
$escaped = array_map(static fn ($value) => "'".addslashes($value)."'", $excluded);
$excludedList = implode(', ', $escaped);
$builder = DB::table('users as u')