• 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

88.89
/src/Metadata/Operation/Factory/OperationMetadataFactory.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\Metadata\Operation\Factory;
15

16
use ApiPlatform\Metadata\Operation;
17
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
18
use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
19

20
final class OperationMetadataFactory implements OperationMetadataFactoryInterface
21
{
22
    private array $localCache = [];
23

24
    public function __construct(private readonly ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, private readonly ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory)
25
    {
UNCOV
26
    }
1,516✔
27

28
    public function create(string $uriTemplate, array $context = []): ?Operation
29
    {
UNCOV
30
        if (isset($this->localCache[$uriTemplate])) {
8✔
31
            return $this->localCache[$uriTemplate];
×
32
        }
33

UNCOV
34
        foreach ($this->resourceNameCollectionFactory->create() as $resourceClass) {
8✔
UNCOV
35
            foreach ($this->resourceMetadataCollectionFactory->create($resourceClass) as $resource) {
8✔
UNCOV
36
                foreach ($resource->getOperations() as $operation) {
8✔
UNCOV
37
                    if ($operation->getUriTemplate() === $uriTemplate || $operation->getName() === $uriTemplate) {
8✔
UNCOV
38
                        return $this->localCache[$uriTemplate] = $operation;
7✔
39
                    }
40
                }
41
            }
42
        }
43

44
        return null;
1✔
45
    }
46
}
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