Completed
Pull Request — master (#61)
by Michal
02:07
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
namespace Tomaj\NetteApi;
4
5
use Tomaj\NetteApi\Authorization\ApiAuthorizationInterface;
6
use Tomaj\NetteApi\Handlers\ApiHandlerInterface;
7
8
class Api
9
{
10
    private $endpoint;
11
12
    private $handler;
13
14
    private $authorization;
15
16 27
    public function __construct(EndpointInterface $endpoint, ApiHandlerInterface $handler, ApiAuthorizationInterface $authorization)
17
    {
18 27
        $this->endpoint = $endpoint;
19 27
        $this->handler = $handler;
20 27
        $this->authorization = $authorization;
21 27
    }
22
23 24
    public function getEndpoint(): EndpointInterface
24
    {
25 24
        return $this->endpoint;
26
    }
27
28 24
    public function getHandler(): ApiHandlerInterface
29
    {
30 24
        return $this->handler;
31
    }
32
33 21
    public function getAuthorization(): ApiAuthorizationInterface
34
    {
35 21
        return $this->authorization;
36
    }
37
}
38