BashShell   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A exec() 0 12 1
1
<?php
2
3
namespace AsyncPHP\Doorman\Shell;
4
5
use AsyncPHP\Doorman\Shell;
6
7
class BashShell implements Shell
8
{
9
    /**
10
     * @inheritdoc
11
     *
12
     * @param string $format
13
     * @param array  $parameters
14
     *
15
     * @return array
16
     */
17
    public function exec($format, array $parameters = array())
18
    {
19
        $parameters = array_map("escapeshellarg", $parameters);
20
21
        array_unshift($parameters, $format);
22
23
        $command = call_user_func_array("sprintf", $parameters);
24
25
        exec($command, $output);
26
27
        return $output;
0 ignored issues
show
Bug Compatibility introduced by
The expression return $output; of type null|array is incompatible with the return type declared by the interface AsyncPHP\Doorman\Shell::exec of type string as it can also be of type array which is not included in this return type.
Loading history...
28
    }
29
}
30