Test Failed
Push — master ( fdad3b...1a9d53 )
by Mike
07:27
created

CommandProvider::addCustomCommands()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
4
namespace Nexus\CustomCommand\Communication\Provider;
5
6
7
use Nexus\Console\Provider\CommandProviderInterface;
8
use Nexus\DockerClient\Communication\Command\Compose\DockerComposeRmCommand;
9
use Nexus\DockerClient\Communication\Command\Compose\DockerComposeUpCommand;
10
use Nexus\DockerClient\Communication\Command\Exec\DockerExecCommand;
11
use Nexus\DockerClient\Communication\Command\Volume\VolumeCreateCommand;
12
use Nexus\DockerClient\Communication\Command\Volume\VolumeRemoveCommand;
13
use Xervice\Config\XerviceConfig;
14
use Xervice\Core\Config\ConfigInterface;
15
use Xervice\Core\Locator\AbstractWithLocator;
16
17
/**
18
 * @method \Nexus\CustomCommand\CustomCommandFacade getFacade()
19
 */
20
class CommandProvider extends AbstractWithLocator implements CommandProviderInterface
21
{
22
    /**
23
     * @param array $commands
24
     *
25
     * @return array
26
     * @throws \Core\Locator\Dynamic\ServiceNotParseable
27
     * @throws \Xervice\Config\Exception\ConfigNotFound
28
     */
29
    public function provideCommands(array $commands): array
30
    {
31
        $this->getFacade()->hydrateCommands(
32
            commands,
33
            $this->getFacade()->getConfig()->getCommandPath(),
34
            true
35
        );
36
37
        return $commands;
38
    }
39
}