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

api-platform / core / 16705318661

03 Aug 2025 01:05PM UTC coverage: 0.0% (-21.9%) from 21.944%
16705318661

Pull #7317

github

web-flow
Merge 1ca8642ff into d06b1a0a0
Pull Request #7317: Fix/4372 skip null values in hal

0 of 14 new or added lines in 3 files covered. (0.0%)

11680 existing lines in 376 files now uncovered.

0 of 51817 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/Symfony/Bundle/DependencyInjection/Compiler/MutatorPass.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\Symfony\Bundle\DependencyInjection\Compiler;
15

16
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Reference;
19

20
final class MutatorPass implements CompilerPassInterface
21
{
22
    public function process(ContainerBuilder $container): void
23
    {
UNCOV
24
        $this->processResourceMutators($container);
×
UNCOV
25
        $this->processOperationMutators($container);
×
26
    }
27

28
    public function processResourceMutators(ContainerBuilder $container): void
29
    {
UNCOV
30
        if (!$container->hasDefinition('api_platform.metadata.mutator_collection.resource')) {
×
31
            return;
×
32
        }
33

UNCOV
34
        $definition = $container->getDefinition('api_platform.metadata.mutator_collection.resource');
×
35

UNCOV
36
        $mutators = $container->findTaggedServiceIds('api_platform.resource_mutator');
×
37

UNCOV
38
        foreach ($mutators as $id => $tags) {
×
39
            foreach ($tags as $tag) {
×
40
                $definition->addMethodCall('add', [
×
41
                    $tag['resourceClass'],
×
42
                    new Reference($id),
×
43
                ]);
×
44
            }
45
        }
46
    }
47

48
    private function processOperationMutators(ContainerBuilder $container): void
49
    {
UNCOV
50
        if (!$container->hasDefinition('api_platform.metadata.mutator_collection.operation')) {
×
51
            return;
×
52
        }
53

UNCOV
54
        $definition = $container->getDefinition('api_platform.metadata.mutator_collection.operation');
×
55

UNCOV
56
        $mutators = $container->findTaggedServiceIds('api_platform.operation_mutator');
×
57

UNCOV
58
        foreach ($mutators as $id => $tags) {
×
59
            foreach ($tags as $tag) {
×
60
                $definition->addMethodCall('add', [
×
61
                    $tag['operationName'],
×
62
                    new Reference($id),
×
63
                ]);
×
64
            }
65
        }
66
    }
67
}
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