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

api-platform / core / 7142557150

08 Dec 2023 02:28PM UTC coverage: 36.003% (-1.4%) from 37.36%
7142557150

push

github

web-flow
fix(jsonld): remove link to ApiDocumentation when doc is disabled (#6029)

0 of 1 new or added line in 1 file covered. (0.0%)

2297 existing lines in 182 files now uncovered.

9992 of 27753 relevant lines covered (36.0%)

147.09 hits per line

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

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

16
use ApiPlatform\Api\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
use Symfony\Component\HttpFoundation\Response;
23

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

41
    /**
42
     * @return Entrypoint|Response
43
     */
44
    public function __invoke(Request $request = null)
45
    {
UNCOV
46
        if ($this->provider && $this->processor) {
×
UNCOV
47
            $context = ['request' => $request];
×
UNCOV
48
            $operation = new Get(outputFormats: $this->documentationFormats, read: true, serialize: true, class: Entrypoint::class, provider: fn () => new Entrypoint($this->resourceNameCollectionFactory->create()));
×
UNCOV
49
            $body = $this->provider->provide($operation, [], $context);
×
50
            // see https://github.com/api-platform/core/issues/5845#issuecomment-1732400657
UNCOV
51
            if ($request && ($apiOperation = $request->attributes->get('_api_operation'))) {
×
52
                $operation = $apiOperation;
×
53
            }
54

UNCOV
55
            return $this->processor->process($body, $operation, [], $context);
×
56
        }
57

UNCOV
58
        return new Entrypoint($this->resourceNameCollectionFactory->create());
×
59
    }
60
}
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