Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
GetRegistrationEndpoint | |
0.00% |
0 / 11 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
configure | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Apps\Anmelden\Endpoints; |
4 | |
5 | use Olz\Api\OlzGetEntityTypedEndpoint; |
6 | |
7 | /** |
8 | * @phpstan-import-type OlzRegistrationId from RegistrationEndpointTrait |
9 | * @phpstan-import-type OlzRegistrationData from RegistrationEndpointTrait |
10 | * |
11 | * TODO: Those should not be necessary! |
12 | * @phpstan-import-type OlzRegistrationInfo from RegistrationEndpointTrait |
13 | * @phpstan-import-type ValidRegistrationInfoType from RegistrationEndpointTrait |
14 | * |
15 | * @extends OlzGetEntityTypedEndpoint<OlzRegistrationId, OlzRegistrationData> |
16 | */ |
17 | class GetRegistrationEndpoint extends OlzGetEntityTypedEndpoint { |
18 | use RegistrationEndpointTrait; |
19 | |
20 | public function configure(): void { |
21 | parent::configure(); |
22 | $this->configureRegistrationEndpointTrait(); |
23 | $this->phpStanUtils->registerTypeImport(RegistrationEndpointTrait::class); |
24 | } |
25 | |
26 | protected function handle(mixed $input): mixed { |
27 | $external_id = $input['id']; |
28 | $internal_id = $this->idUtils()->toInternalId($external_id, 'Registration'); |
29 | |
30 | $entity = $this->getEntityById($internal_id); |
31 | |
32 | return [ |
33 | 'id' => $external_id, |
34 | 'meta' => $entity->getMetaData(), |
35 | 'data' => $this->getEntityData($entity), |
36 | ]; |
37 | } |
38 | } |