Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
GetRegistrationEndpoint | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
handle | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 |
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 | protected function handle(mixed $input): mixed { |
21 | $external_id = $input['id']; |
22 | $internal_id = $this->idUtils()->toInternalId($external_id, 'Registration'); |
23 | |
24 | $entity = $this->getEntityById($internal_id); |
25 | |
26 | return [ |
27 | 'id' => $external_id, |
28 | 'meta' => $entity->getMetaData(), |
29 | 'data' => $this->getEntityData($entity), |
30 | ]; |
31 | } |
32 | } |