Provider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 37
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A execute() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Shell\Business\Provider;
6
7
8
use Xervice\Shell\Business\Command\ConverterInterface;
9
use Xervice\Shell\Business\Executor\ExecutorInterface;
10
11
class Provider implements ProviderInterface
12
{
13
    /**
14
     * @var ExecutorInterface
15
     */
16
    private $executor;
17
18
    /**
19
     * @var \Xervice\Shell\Business\Command\ConverterInterface
20
     */
21
    private $conveter;
22
23
    /**
24
     * Provider constructor.
25
     *
26
     * @param \Xervice\Shell\Business\Executor\ExecutorInterface $executor
27
     * @param \Xervice\Shell\Business\Command\ConverterInterface $conveter
28
     */
29 1
    public function __construct(
30
        ExecutorInterface $executor,
31
        ConverterInterface $conveter
32
    ) {
33 1
        $this->executor = $executor;
34 1
        $this->conveter = $conveter;
35 1
    }
36
37
38
    /**
39
     * @param string $command
40
     * @param mixed ...$params
41
     *
42
     * @return string
43
     */
44 1
    public function execute(string $command, ...$params): string
45
    {
46 1
        return $this->executor->execute(
47 1
            $this->conveter->convert($command, ...$params)
48
        );
49
    }
50
}