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
{
$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);
$document->addSheet(SheetData::from([
@ -68,10 +72,11 @@ class CreateExcelDocumentAction
/** @return array<string, mixed> */
public function rowFor(Participant $participant): array {
return $this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw())
->put('Abgemeldet am', $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '')
->prepend('ID', $participant->id)
->toArray();
return [
'ID' => $participant->id,
...$this->form->getFields()->map(fn ($field) => $participant->getFields()->find($field)->presentRaw()),
'Abgemeldet am' => $participant->cancelled_at?->format('d.m.Y H:i:s') ?: '',
];
}
private function tempPath(): string