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

Api::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
crap 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