Lines
100.00%
2 / 2
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| LinkListProvider | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| provide | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace App\State; | |
| 6 | ||
| 7 | use ApiPlatform\Metadata\Operation; | |
| 8 | use ApiPlatform\State\ProviderInterface; | |
| 9 | use App\ApiResource\LinkList; | |
| 10 | use App\LinkList\LinkListLoader; | |
| 11 | ||
| 12 | /** | |
| 13 | * GET /api/links: the link list of docs/links.md. | |
| 14 | * | |
| 15 | * @implements ProviderInterface<LinkList> | |
| 16 | */ | |
| 17 | final readonly class LinkListProvider implements ProviderInterface | |
| 18 | { | |
| 19 | public function __construct(private LinkListLoader $loader) | |
| 20 | { | |
| 21 | } | |
| 22 | ||
| 23 | public function provide(Operation $operation, array $uriVariables = [], array $context = []): LinkList | |
| 24 | { | |
| 25 | return $this->loader->load(); | |
| 26 | } | |
| 27 | } |