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

SilentProcessRunner::followsUpWith()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
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