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

api-platform / core / 9710673650

25 Jun 2024 02:01PM UTC coverage: 61.693% (-0.9%) from 62.637%
9710673650

push

github

web-flow
feat(laravel): laravel component (#5882)

* feat(laravel): laravel component

* try to skip laravel

* feat(jsonapi): component

* feat(laravel): json api support (needs review)

* work on relations

* relations (needs toMany) + skolem + IRI to resource

* links handler

* ulid

* validation

* slug post

* remove deprecations

* move classes

* fix tests

* fix tests metadata

* phpstan

* missing class

* fix laravel tests

* fix stan

33 of 77 new or added lines in 20 files covered. (42.86%)

140 existing lines in 15 files now uncovered.

10787 of 17485 relevant lines covered (61.69%)

59.64 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,
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

© 2025 Coveralls, Inc