Completed
Push — master ( 42ec0b...db7032 )
by John
01:57
created

SingleEndpointFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 37
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getEndpoint() 0 4 1
A getSupportedEndpoints() 0 4 1
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 2
    public function __construct(Endpoint $singleEndpoint)
21
    {
22 2
        $this->singleEndpoint = $singleEndpoint;
23 2
    }
24
25
    /**
26
     * @param string $name
27
     * @param string $version
28
     * @return Endpoint
29
     * @throws UnknownEndpointException
30
     */
31 1
    public function getEndpoint(string $name, string $version): Endpoint
32
    {
33 1
        return $this->singleEndpoint;
34
    }
35
36
    /**
37
     * @param string $version
38
     * @return string[]
39
     */
40 1
    public function getSupportedEndpoints(string $version): array
41
    {
42 1
        return [];
43
    }
44
}
45