• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 21006071786

14 Jan 2026 06:53PM UTC coverage: 21.366% (-7.7%) from 29.097%
21006071786

Pull #7675

github

web-flow
Merge 5c98a7330 into 73402fc61
Pull Request #7675: feat(doctrine): Add caseInsensitive option to PartialSearchFilter

0 of 11 new or added lines in 2 files covered. (0.0%)

15054 existing lines in 491 files now uncovered.

12306 of 57596 relevant lines covered (21.37%)

49.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/State/Processor/AddLinkHeaderProcessor.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\State\Processor;
15

16
use ApiPlatform\Metadata\Operation;
17
use ApiPlatform\State\ProcessorInterface;
18
use ApiPlatform\State\StopwatchAwareInterface;
19
use ApiPlatform\State\StopwatchAwareTrait;
20
use Symfony\Component\HttpFoundation\Response;
21
use Symfony\Component\WebLink\HttpHeaderSerializer;
22

23
/**
24
 * @template T1
25
 * @template T2
26
 *
27
 * @implements ProcessorInterface<T1, T2>
28
 */
29
final class AddLinkHeaderProcessor implements ProcessorInterface, StopwatchAwareInterface
30
{
31
    use StopwatchAwareTrait;
32

33
    /**
34
     * @param ProcessorInterface<T1, T2> $decorated
35
     */
36
    public function __construct(private readonly ProcessorInterface $decorated, private readonly ?HttpHeaderSerializer $serializer = new HttpHeaderSerializer())
37
    {
UNCOV
38
    }
1,251✔
39

40
    public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): mixed
41
    {
UNCOV
42
        $response = $this->decorated->process($data, $operation, $uriVariables, $context);
1,243✔
43

44
        if (
UNCOV
45
            !($request = $context['request'] ?? null)
1,243✔
UNCOV
46
            || !$response instanceof Response
1,243✔
47
        ) {
48
            return $response;
×
49
        }
50

UNCOV
51
        $this->stopwatch?->start('api_platform.processor.add_link_header');
1,243✔
52
        // We add our header here as Symfony does it only for the main Request and we want it to be done on errors (sub-request) as well
UNCOV
53
        $linksProvider = $request->attributes->get('_api_platform_links');
1,243✔
UNCOV
54
        if ($this->serializer && ($links = $linksProvider?->getLinks())) {
1,243✔
UNCOV
55
            $response->headers->set('Link', $this->serializer->serialize($links));
1,243✔
56
        }
UNCOV
57
        $this->stopwatch?->stop('api_platform.processor.add_link_header');
1,243✔
58

UNCOV
59
        return $response;
1,243✔
60
    }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc