Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
14 | abstract class Repository implements RepositoryInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var mixed |
||
18 | */ |
||
19 | private $gateway; |
||
20 | |||
21 | 5 | public function __construct($gateway = null) |
|
22 | { |
||
23 | 5 | if (!\is_null($gateway)) { |
|
24 | 1 | $this->setGateway($gateway); |
|
25 | } |
||
26 | 5 | } |
|
27 | |||
28 | 3 | public function setGateway($gateway): void |
|
29 | { |
||
30 | 3 | $this->gateway = $gateway; |
|
31 | 3 | } |
|
32 | |||
33 | /** |
||
34 | * @throws UndefinedGatewayRepositoryException |
||
35 | * |
||
36 | * @return mixed |
||
37 | */ |
||
38 | 4 | public function getGateway() |
|
45 | } |
||
46 | } |
||
47 |