SilentProcessRunner   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 14 2
A followsUpWith() 0 4 1
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