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

api-platform / core / 20730399358

05 Jan 2026 09:57PM UTC coverage: 25.213% (-3.7%) from 28.866%
20730399358

Pull #7645

github

web-flow
Merge ab5d76b8d into 7d4b5e9c5
Pull Request #7645: 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.

14665 of 58164 relevant lines covered (25.21%)

29.86 hits per line

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

0.0
/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
    }
×
29

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

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

UNCOV
43
        foreach ($this->metadataExtractor->getResources() as $resource) {
×
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));
×
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