Completed
Push — master ( 876aec...44d674 )
by John
03:09
created

SingleEndpointFactory::getEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
namespace LunixRESTBasics\Endpoint;
3
4
use LunixREST\Endpoint\Endpoint;
5
use LunixREST\Endpoint\EndpointFactory;
6
use LunixREST\Endpoint\Exceptions\UnknownEndpointException;
7
8
class SingleEndpointFactory implements EndpointFactory
9
{
10
11
    /**
12
     * @var Endpoint
13
     */
14
    private $singleEndpoint;
15
16
    /**
17
     * SingleEndpointFactory constructor.
18
     * @param Endpoint $singleEndpoint
19
     */
20
    public function __construct(Endpoint $singleEndpoint)
21
    {
22
        $this->singleEndpoint = $singleEndpoint;
23
    }
24
25
    /**
26
     * @param string $name
27
     * @param string $version
28
     * @return Endpoint
29
     * @throws UnknownEndpointException
30
     */
31
    public function getEndpoint(string $name, string $version): Endpoint
32
    {
33
        return $this->singleEndpoint;
34
    }
35
36
    /**
37
     * @param string $version
38
     * @return string[]
39
     */
40
    public function getSupportedEndpoints(string $version): array
41
    {
42
        return [];
43
    }
44
}
45