ShellExec::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
4
namespace Nexus\Shell\Business\Model\Executor;
5
6
7
class ShellExec implements ExecutorInterface
8
{
9
    /**
10
     * @param string $command
11
     *
12
     * @return string
13
     */
14
    public function execute(string $command): string
15
    {
16
        $result = shell_exec($command);
17
        if ($result === null) {
18
            $result = '';
19
        }
20
        return $result;
21
    }
22
23
}