DeployFactory::createDeploy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
4
namespace Deployee\Plugins\Deploy\Definitions\Deploy;
5
6
use Deployee\Components\Dependency\ContainerResolver;
7
8
class DeployFactory
9
{
10
    /**
11
     * @var ContainerResolver
12
     */
13
    private $resolver;
14
15
    /**
16
     * @param ContainerResolver $resolver
17
     */
18
    public function __construct(ContainerResolver $resolver)
19
    {
20
        $this->resolver = $resolver;
21
    }
22
23
    /**
24
     * @param string $class
25
     * @return DeployDefinitionInterface
26
     * @throws \ReflectionException
27
     */
28
    public function createDeploy(string $class): DeployDefinitionInterface
29
    {
30
        /* @var DeployDefinitionInterface $object */
31
        $object = $this->resolver->createInstance($class);
32
        return $object;
33
    }
34
}