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

api-platform / core / 20847864477

09 Jan 2026 09:47AM UTC coverage: 29.1% (+0.005%) from 29.095%
20847864477

Pull #7649

github

web-flow
Merge b342dd5db into d640d106b
Pull Request #7649: feat(validator): uuid/ulid parameter validation

0 of 4 new or added lines in 1 file covered. (0.0%)

15050 existing lines in 491 files now uncovered.

16996 of 58406 relevant lines covered (29.1%)

81.8 hits per line

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

93.75
/src/State/Processor/RespondProcessor.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\HttpOperation;
17
use ApiPlatform\Metadata\IriConverterInterface;
18
use ApiPlatform\Metadata\Operation;
19
use ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactoryInterface;
20
use ApiPlatform\Metadata\ResourceClassResolverInterface;
21
use ApiPlatform\State\ProcessorInterface;
22
use ApiPlatform\State\StopwatchAwareInterface;
23
use ApiPlatform\State\StopwatchAwareTrait;
24
use ApiPlatform\State\Util\HttpResponseHeadersTrait;
25
use ApiPlatform\State\Util\HttpResponseStatusTrait;
26
use Symfony\Component\HttpFoundation\Response;
27

28
/**
29
 * Serializes data.
30
 *
31
 * @author Kévin Dunglas <dunglas@gmail.com>
32
 */
33
final class RespondProcessor implements ProcessorInterface, StopwatchAwareInterface
34
{
35
    use HttpResponseHeadersTrait;
36
    use HttpResponseStatusTrait;
37
    use StopwatchAwareTrait;
38

39
    public function __construct(
40
        ?IriConverterInterface $iriConverter = null,
41
        ?ResourceClassResolverInterface $resourceClassResolver = null,
42
        ?OperationMetadataFactoryInterface $operationMetadataFactory = null,
43
    ) {
UNCOV
44
        $this->iriConverter = $iriConverter;
2,059✔
UNCOV
45
        $this->resourceClassResolver = $resourceClassResolver;
2,059✔
UNCOV
46
        $this->operationMetadataFactory = $operationMetadataFactory;
2,059✔
47
    }
48

49
    public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = [])
50
    {
UNCOV
51
        if ($data instanceof Response || !$operation instanceof HttpOperation) {
2,039✔
UNCOV
52
            return $data;
65✔
53
        }
54

UNCOV
55
        if (!($request = $context['request'] ?? null)) {
1,978✔
56
            return $data;
×
57
        }
58

UNCOV
59
        $this->stopwatch?->start('api_platform.processor.respond');
1,978✔
60

UNCOV
61
        $status = $this->getStatus($request, $operation, $context);
1,978✔
UNCOV
62
        $headers = $this->getHeaders($request, $operation, $context);
1,978✔
63

UNCOV
64
        $this->stopwatch?->stop('api_platform.processor.respond');
1,978✔
65

UNCOV
66
        return new Response(
1,978✔
UNCOV
67
            $data,
1,978✔
UNCOV
68
            $status,
1,978✔
UNCOV
69
            $headers
1,978✔
UNCOV
70
        );
1,978✔
71
    }
72
}
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