SymfonyProcessRunner   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 11 2
1
<?php
2
3
namespace MyBuilder\Cronos\Updater;
4
5
use Symfony\Component\Process\Process;
6
7
class SymfonyProcessRunner implements ProcessRunner
8
{
9
    public function run(array $command): string
10
    {
11
        $process = new Process($command);
12
        $process->run();
13
14
        if (false === $process->isSuccessful()) {
15
            throw new \RuntimeException($process->getErrorOutput());
16
        }
17
18
        return $process->getOutput();
19
    }
20
}
21