Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
GetTerminLabelEndpoint | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
configure | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
handle | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Olz\Termine\Endpoints; |
4 | |
5 | use Olz\Api\OlzGetEntityTypedEndpoint; |
6 | |
7 | /** |
8 | * @phpstan-import-type OlzTerminLabelId from TerminLabelEndpointTrait |
9 | * @phpstan-import-type OlzTerminLabelData from TerminLabelEndpointTrait |
10 | * |
11 | * @extends OlzGetEntityTypedEndpoint<OlzTerminLabelId, OlzTerminLabelData> |
12 | */ |
13 | class GetTerminLabelEndpoint extends OlzGetEntityTypedEndpoint { |
14 | use TerminLabelEndpointTrait; |
15 | |
16 | public function configure(): void { |
17 | parent::configure(); |
18 | $this->phpStanUtils->registerTypeImport(TerminLabelEndpointTrait::class); |
19 | } |
20 | |
21 | protected function handle(mixed $input): mixed { |
22 | $this->checkPermission('any'); |
23 | |
24 | $entity = $this->getEntityById($input['id']); |
25 | |
26 | return [ |
27 | 'id' => $entity->getId() ?? 0, |
28 | 'meta' => $entity->getMetaData(), |
29 | 'data' => $this->getEntityData($entity), |
30 | ]; |
31 | } |
32 | } |