Lint
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2025-11-12 01:48:56 +01:00
parent 2f2c5c660b
commit abc792d5b7
1 changed files with 10 additions and 5 deletions

View File

@ -31,7 +31,11 @@ class CreateExcelDocumentAction
private function allSheet(Collection $participants): TableDocumentData private function allSheet(Collection $participants): TableDocumentData
{ {
$document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]); $document = TableDocumentData::from(['title' => 'Anmeldungen für ' . $this->form->name, 'sheets' => []]);
$headers = $this->form->getFields()->map(fn ($field) => $field->name)->push('Abgemeldet am')->prepend('ID')->toArray(); $headers = [
'ID',
...$this->form->getFields()->names(),
'Abgemeldet am',
];
[$activeParticipants, $cancelledParticipants] = $participants->partition(fn ($participant) => $participant->cancelled_at === null); [$activeParticipants, $cancelledParticipants] = $participants->partition(fn ($participant) => $participant->cancelled_at === null);
$document->addSheet(SheetData::from([ $document->addSheet(SheetData::from([
@ -68,10 +72,11 @@ class CreateExcelDocumentAction
/** @return array<string, mixed> */ /** @return array<string, mixed> */
public function rowFor(Participant $participant): array { public function rowFor(Participant $participant): array {
return $this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw()) return [
->put('Abgemeldet am', $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '') 'ID' => $participant->id,
->prepend('ID', $participant->id) ...$this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw()),
->toArray(); 'Abgemeldet am' => $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '',
];
} }
private function tempPath(): string private function tempPath(): string