Completed
Pull Request — master (#607)
by Kévin
03:12
created

EntrypointAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <[email protected]>
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
namespace ApiPlatform\Core\Hydra\Action;
13
14
use ApiPlatform\Core\JsonLd\EntrypointBuilderInterface;
15
use Symfony\Component\HttpFoundation\JsonResponse;
16
use Symfony\Component\HttpFoundation\Request;
17
18
/**
19
 * Generates the JSON-LD API entrypoint.
20
 *
21
 * @author Kévin Dunglas <[email protected]>
22
 */
23
final class EntrypointAction
24
{
25
    private $entrypointBuilder;
26
27
    public function __construct(EntrypointBuilderInterface $entrypointBuilder)
28
    {
29
        $this->entrypointBuilder = $entrypointBuilder;
30
    }
31
32
    public function __invoke() : array
33
    {
34
        return $this->entrypointBuilder->getEntrypoint();
35
    }
36
}
37