AbstractCommunicationFactory::getConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Xervice\Core\Business\Model\Factory;
5
6
7
use Xervice\Core\Business\Model\Config\ConfigInterface;
8
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
9
use Xervice\Core\Business\Model\Facade\FacadeInterface;
10
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
68
    {
69
        return $this->facade;
70
    }
71
72
73
}