Completed
Push — master ( 41a25f...269818 )
by Mike
02:08
created

AbstractCommunicationFactory::getConfig()   A

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
10
class AbstractCommunicationFactory implements FactoryInterface
11
{
12
    /**
13
     * @var \Xervice\Core\Business\Model\Config\ConfigInterface
14
     */
15
    protected $config;
16
17
    /**
18
     * @var \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
19
     */
20
    protected $container;
21
22
    /**
23
     * AbstractBusinessFactory constructor.
24
     *
25
     * @param \Xervice\Core\Business\Model\Config\ConfigInterface $config
26
     * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
27
     */
28 1
    public function __construct(ConfigInterface $config, DependencyContainerInterface $container)
29
    {
30 1
        $this->config = $config;
31 1
        $this->container = $container;
32 1
    }
33
34
    /**
35
     * @return \Xervice\Core\Business\Model\Config\ConfigInterface
36
     */
37
    protected function getConfig(): ConfigInterface
38
    {
39
        return $this->config;
40
    }
41
42
    /**
43
     * @param string $key
44
     *
45
     * @return mixed
46
     */
47
    protected function getDependency(string $key)
48
    {
49
        return $this->container->get($key);
50
    }
51
}