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

api-platform / core / 20745879029

06 Jan 2026 10:43AM UTC coverage: 28.884% (+0.04%) from 28.843%
20745879029

Pull #7647

github

web-flow
Merge 4e69048e9 into d23ab4301
Pull Request #7647: fix(doctrine): fix partial fetch with same entity included multiple time with different fields

32 of 117 new or added lines in 2 files covered. (27.35%)

378 existing lines in 45 files now uncovered.

16832 of 58274 relevant lines covered (28.88%)

78.61 hits per line

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

63.64
/src/Metadata/Resource/Factory/PhpFileResourceNameCollectionFactory.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\Resource\Factory;
15

16
use ApiPlatform\Metadata\Extractor\ResourceExtractorInterface;
17
use ApiPlatform\Metadata\Resource\ResourceNameCollection;
18

19
/**
20
 * @internal
21
 */
22
final class PhpFileResourceNameCollectionFactory implements ResourceNameCollectionFactoryInterface
23
{
24
    public function __construct(
25
        private readonly ResourceExtractorInterface $metadataExtractor,
26
        private readonly ?ResourceNameCollectionFactoryInterface $decorated = null,
27
    ) {
UNCOV
28
    }
1,520✔
29

30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function create(): ResourceNameCollection
34
    {
UNCOV
35
        $classes = [];
2✔
36

UNCOV
37
        if ($this->decorated) {
2✔
UNCOV
38
            foreach ($this->decorated->create() as $resourceClass) {
2✔
UNCOV
39
                $classes[$resourceClass] = true;
2✔
40
            }
41
        }
42

UNCOV
43
        foreach ($this->metadataExtractor->getResources() as $resource) {
2✔
44
            $resourceClass = $resource->getClass();
×
45

46
            if (null === $resourceClass) {
×
47
                continue;
×
48
            }
49

50
            $classes[$resourceClass] = true;
×
51
        }
52

UNCOV
53
        return new ResourceNameCollection(array_keys($classes));
2✔
54
    }
55
}
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