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

api-platform / core / 20731005384

05 Jan 2026 10:23PM UTC coverage: 28.843% (-0.02%) from 28.866%
20731005384

Pull #7645

github

web-flow
Merge 3bfd10bce into 7d4b5e9c5
Pull Request #7645: fix(doctrine): fix partial fetch when relation switches context

8 of 73 new or added lines in 2 files covered. (10.96%)

395 existing lines in 52 files now uncovered.

16778 of 58170 relevant lines covered (28.84%)

78.49 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