Completed
Pull Request — master (#608)
by Amrouche
03:47
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\Action;
13
14
use ApiPlatform\Core\JsonLd\EntrypointBuilderInterface;
15
16
/**
17
 * Generates the API entrypoint.
18
 *
19
 * @author Kévin Dunglas <[email protected]>
20
 */
21
final class EntrypointAction
22
{
23
    private $entrypointBuilder;
24
25
    public function __construct(EntrypointBuilderInterface $entrypointBuilder)
26
    {
27
        $this->entrypointBuilder = $entrypointBuilder;
28
    }
29
30
    public function __invoke() : array
31
    {
32
        return $this->entrypointBuilder->getEntrypoint();
33
    }
34
}
35