Completed
Pull Request — master (#61)
by Michal
02:15
created

Api   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getEndpoint() 0 4 1
A getHandler() 0 4 1
A getAuthorization() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tomaj\NetteApi;
6
7
use Tomaj\NetteApi\Authorization\ApiAuthorizationInterface;
8
use Tomaj\NetteApi\Handlers\ApiHandlerInterface;
9
10
class Api
11
{
12
    private $endpoint;
13
14
    private $handler;
15
16
    private $authorization;
17
18 30
    public function __construct(EndpointInterface $endpoint, ApiHandlerInterface $handler, ApiAuthorizationInterface $authorization)
19
    {
20 30
        $this->endpoint = $endpoint;
21 30
        $this->handler = $handler;
22 30
        $this->authorization = $authorization;
23 30
    }
24
25 27
    public function getEndpoint(): EndpointInterface
26
    {
27 27
        return $this->endpoint;
28
    }
29
30 27
    public function getHandler(): ApiHandlerInterface
31
    {
32 27
        return $this->handler;
33
    }
34
35 24
    public function getAuthorization(): ApiAuthorizationInterface
36
    {
37 24
        return $this->authorization;
38
    }
39
}
40