DnfCommandBuilder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCommand() 0 12 1
1
<?php
2
/**
3
 * This file is part of RoboSystemPackage.
4
 *
5
 * @author      Aitor García Martínez (Falc) <[email protected]>
6
 * @copyright   2015 Aitor García Martínez (Falc) <[email protected]>
7
 * @license     MIT
8
 */
9
10
namespace Falc\Robo\Package\CommandBuilder;
11
12
/**
13
 * Dnf command builder.
14
 */
15
class DnfCommandBuilder extends YumCommandBuilder
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 9
    public function getCommand()
21
    {
22 9
        $packages = implode(' ', array_unique($this->packages));
23 9
        $options = implode(' ', array_unique($this->options));
24
25 9
        $command = "dnf {$options} {$this->action} {$packages}";
26
27
        // Remove extra whitespaces
28 9
        $command = preg_replace('/\s+/', ' ', trim($command));
29
30 9
        return $command;
31
    }
32
}
33