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

api-platform / core / 17562281609

08 Sep 2025 07:47PM UTC coverage: 0.0% (-22.6%) from 22.604%
17562281609

Pull #7374

github

web-flow
Merge 0c2b4a90a into 6db55be8c
Pull Request #7374: fix(jsonld): various json streamer fixes

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

12082 existing lines in 401 files now uncovered.

0 of 52792 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/src/State/Processor/WriteProcessor.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\Metadata\Util\ClassInfoTrait;
18
use ApiPlatform\State\ProcessorInterface;
19
use ApiPlatform\State\StopwatchAwareInterface;
20
use ApiPlatform\State\StopwatchAwareTrait;
21
use Symfony\Component\HttpFoundation\Response;
22

23
/**
24
 * Bridges persistence and the API system.
25
 *
26
 * @template T1
27
 * @template T2
28
 *
29
 * @implements ProcessorInterface<T1, T2>
30
 *
31
 * @author Kévin Dunglas <dunglas@gmail.com>
32
 * @author Baptiste Meyer <baptiste.meyer@gmail.com>
33
 */
34
final class WriteProcessor implements ProcessorInterface, StopwatchAwareInterface
35
{
36
    use ClassInfoTrait;
37
    use StopwatchAwareTrait;
38

39
    /**
40
     * @param ProcessorInterface<mixed, mixed> $processor
41
     * @param ProcessorInterface<mixed, mixed> $callableProcessor
42
     */
43
    public function __construct(private readonly ?ProcessorInterface $processor, private readonly ProcessorInterface $callableProcessor)
44
    {
UNCOV
45
    }
×
46

47
    public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = [])
48
    {
49
        if (
UNCOV
50
            $data instanceof Response
×
UNCOV
51
            || !($operation->canWrite() ?? true)
×
UNCOV
52
            || !$operation->getProcessor()
×
53
        ) {
UNCOV
54
            return $this->processor ? $this->processor->process($data, $operation, $uriVariables, $context) : $data;
×
55
        }
56

UNCOV
57
        $this->stopwatch?->start('api_platform.processor.write');
×
UNCOV
58
        $data = $this->callableProcessor->process($data, $operation, $uriVariables, $context);
×
UNCOV
59
        $this->stopwatch?->stop('api_platform.processor.write');
×
60

UNCOV
61
        return $this->processor ? $this->processor->process($data, $operation, $uriVariables, $context) : $data;
×
62
    }
63
}
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

© 2025 Coveralls, Inc