Completed
Push — master ( 95a54c...7178fa )
by Samuel
10:58
created

SilentProcessRunner::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 14
rs 9.4285
cc 2
eloc 7
nc 2
nop 2
1
<?php
2
3
namespace Dock\IO;
4
5
use Symfony\Component\Process\Process;
6
7
class SilentProcessRunner implements ProcessRunner
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    public function run($command, $mustSucceed = true)
13
    {
14
        $process = new Process($command);
15
16
        if ($mustSucceed) {
17
            $process->setTimeout(null);
18
19
            return $process->mustRun();
20
        }
21
22
        $process->run();
23
24
        return $process;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function followsUpWith($command, array $arguments = [])
31
    {
32
        pcntl_exec($command, $arguments);
33
    }
34
}
35