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

api-platform / core / 17487610263

05 Sep 2025 08:12AM UTC coverage: 22.608% (+0.3%) from 22.319%
17487610263

push

github

web-flow
chore: remove @experimental flag from parameters (#7357)

12049 of 53296 relevant lines covered (22.61%)

26.21 hits per line

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

94.74
/src/Symfony/Messenger/Metadata/MessengerResourceMetadataCollectionFactory.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\Messenger\Metadata;
15

16
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
17
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
18
use ApiPlatform\Symfony\Messenger\Processor;
19

20
final class MessengerResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
21
{
22
    public function __construct(private readonly ResourceMetadataCollectionFactoryInterface $decorated)
23
    {
24
    }
722✔
25

26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function create(string $resourceClass): ResourceMetadataCollection
30
    {
31
        $resourceMetadataCollection = $this->decorated->create($resourceClass);
112✔
32

33
        foreach ($resourceMetadataCollection as $i => $resourceMetadata) {
112✔
34
            $operations = $resourceMetadata->getOperations();
110✔
35

36
            if ($operations) {
110✔
37
                foreach ($resourceMetadata->getOperations() as $operationName => $operation) {
110✔
38
                    if (null !== $operation->getProcessor() || false === ($operation->getMessenger() ?? false)) {
110✔
39
                        continue;
110✔
40
                    }
41

42
                    $operations->add($operationName, $operation->withProcessor(Processor::class));
2✔
43
                }
44

45
                $resourceMetadata = $resourceMetadata->withOperations($operations);
110✔
46
            }
47

48
            $graphQlOperations = $resourceMetadata->getGraphQlOperations();
110✔
49

50
            if ($graphQlOperations) {
110✔
51
                foreach ($graphQlOperations as $operationName => $graphQlOperation) {
80✔
52
                    if (null !== $graphQlOperation->getProcessor() || false === ($graphQlOperation->getMessenger() ?? false)) {
80✔
53
                        continue;
80✔
54
                    }
55

56
                    $graphQlOperations[$operationName] = $graphQlOperation->withProcessor(Processor::class);
×
57
                }
58

59
                $resourceMetadata = $resourceMetadata->withGraphQlOperations($graphQlOperations);
80✔
60
            }
61

62
            $resourceMetadataCollection[$i] = $resourceMetadata;
110✔
63
        }
64

65
        return $resourceMetadataCollection;
112✔
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

© 2026 Coveralls, Inc