Passed
Push — master ( 1be2c9...3b7d80 )
by Nils
02:34
created

Runner   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 1
1
<?php
2
3
namespace Startwind\Inventorio\Exec;
4
5
use Symfony\Component\Process\Process;
6
7
abstract class Runner
8
{
9
    public static function run($command, $killAfterSeconds = 5): Process
10
    {
11
        $shellCommandLine = "timeout --kill-after=" . $killAfterSeconds . "s 1m " . $command;
12
13
        $process = Process::fromShellCommandline($shellCommandLine);
14
15
        $process->run();
16
17
        return $process;
18
    }
19
}