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

api-platform / core / 6418833342

05 Oct 2023 12:11PM UTC coverage: 37.157% (+0.4%) from 36.79%
6418833342

push

github

web-flow
chore: move namespace Api Metadata (#5857)

57 of 57 new or added lines in 8 files covered. (100.0%)

10191 of 27427 relevant lines covered (37.16%)

17.94 hits per line

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

0.0
/src/Documentation/Action/EntrypointAction.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\Documentation\Action;
15

16
use ApiPlatform\Documentation\Entrypoint;
17
use ApiPlatform\Metadata\Get;
18
use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
19
use ApiPlatform\State\ProcessorInterface;
20
use ApiPlatform\State\ProviderInterface;
21
use Symfony\Component\HttpFoundation\Request;
22

23
/**
24
 * Generates the API entrypoint.
25
 *
26
 * @author Kévin Dunglas <dunglas@gmail.com>
27
 */
28
final class EntrypointAction
29
{
30
    public function __construct(
31
        private readonly ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory,
32
        private readonly ProviderInterface $provider,
33
        private readonly ProcessorInterface $processor,
34
        private readonly array $documentationFormats = []
35
    ) {
36
    }
×
37

38
    public function __invoke(Request $request = null)
39
    {
40
        $context = ['request' => $request];
×
41
        $operation = new Get(outputFormats: $this->documentationFormats, read: true, serialize: true, class: Entrypoint::class, provider: fn () => new Entrypoint($this->resourceNameCollectionFactory->create()));
×
42
        $body = $this->provider->provide($operation, [], $context);
×
43

44
        return $this->processor->process($body, $operation, [], $context);
×
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