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
3declare(strict_types=1);
4
5namespace App\State;
6
7use ApiPlatform\Metadata\Operation;
8use ApiPlatform\State\ProviderInterface;
9use App\ApiResource\LinkList;
10use App\LinkList\LinkListLoader;
11
12/**
13 * GET /api/links: the link list of docs/links.md.
14 *
15 * @implements ProviderInterface<LinkList>
16 */
17final 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}