Total Complexity | 4 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 45.45% |
Changes | 0 |
1 | <?php |
||
11 | class AbstractCommunicationFactory implements FactoryInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var \Xervice\Core\Business\Model\Config\ConfigInterface |
||
15 | */ |
||
16 | protected $config; |
||
17 | |||
18 | /** |
||
19 | * @var \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface |
||
20 | */ |
||
21 | protected $container; |
||
22 | |||
23 | /** |
||
24 | * @var \Xervice\Core\Business\Model\Facade\FacadeInterface |
||
25 | */ |
||
26 | protected $facade; |
||
27 | |||
28 | /** |
||
29 | * AbstractCommunicationFactory constructor. |
||
30 | * |
||
31 | * @param \Xervice\Core\Business\Model\Config\ConfigInterface $config |
||
32 | * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container |
||
33 | * @param \Xervice\Core\Business\Model\Facade\FacadeInterface $facade |
||
34 | */ |
||
35 | 1 | public function __construct( |
|
36 | ConfigInterface $config, |
||
37 | DependencyContainerInterface $container, |
||
38 | FacadeInterface $facade |
||
39 | ) { |
||
40 | 1 | $this->config = $config; |
|
41 | 1 | $this->container = $container; |
|
42 | 1 | $this->facade = $facade; |
|
43 | 1 | } |
|
44 | |||
45 | |||
46 | /** |
||
47 | * @return \Xervice\Core\Business\Model\Config\ConfigInterface |
||
48 | */ |
||
49 | protected function getConfig(): ConfigInterface |
||
50 | { |
||
51 | return $this->config; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param string $key |
||
56 | * |
||
57 | * @return mixed |
||
58 | */ |
||
59 | protected function getDependency(string $key) |
||
60 | { |
||
61 | return $this->container->get($key); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return \Xervice\Core\Business\Model\Facade\FacadeInterface |
||
66 | */ |
||
67 | public function getFacade(): FacadeInterface |
||
70 | } |
||
71 | |||
72 | |||
73 | } |