Run::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Hairmare\Dodat;
4
5
use Symfony\Component\Process\Process;
6
7
class Run
8
{
9
    /**
10
     * @var string[]
11
     */
12
    private $scripts = array();
13
14
    /**
15
     * @param string[] $scripts
16
     */
17 1
    public function setScripts($scripts)
18
    {
19 1
        $this->scripts = $scripts;
20 1
    }
21
22 1
    public function run()
23
    {
24 1
        foreach ($this->scripts as $script) {
25 1
            $process = new Process($script);
26 1
            $process->run(function ($type, $buffer) {
27 1
                echo $buffer;
28 1
            });
29 1
        }
30 1
    }
31
}
32