adrema/app/Contribution/ContributionFactory.php

32 lines
771 B
PHP
Raw Normal View History

2022-11-17 21:47:45 +01:00
<?php
namespace App\Contribution;
use App\Contribution\Documents\ContributionDocument;
use App\Contribution\Documents\DvDocument;
2022-11-17 22:59:16 +01:00
use App\Contribution\Documents\RemscheidDocument;
2022-11-17 21:47:45 +01:00
use App\Contribution\Documents\SolingenDocument;
class ContributionFactory
{
/**
* @var array<int, class-string<ContributionDocument>>
*/
private array $documents = [
DvDocument::class,
SolingenDocument::class,
2022-11-17 22:59:16 +01:00
RemscheidDocument::class,
2022-11-17 21:47:45 +01:00
];
/**
* @return array<int, array{id: string, name: string}>
*/
public function compilerSelect(): array
{
return collect($this->documents)->map(fn ($document) => [
'title' => $document::getName(),
'class' => $document,
])->toArray();
}
}