Completed
Push — master ( f0448f...4201d1 )
by Julien
14s
created

Hercule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A setHandledEvents() 0 12 2
1
<?php
2
namespace TheAentMachine\AentDockerCompose\Aenthill;
3
4
use Symfony\Component\Process\Process;
5
6
class Hercule
7
{
8
    const BINARY = 'hercule';
9
10
    /**
11
     * @param string[] $events
12
     * @return int
13
     */
14
    public static function setHandledEvents(array $events): int
15
    {
16
        $command = Hercule::BINARY . ' set:handled-events';
17
        foreach ($events as $event) {
18
            $command .= " $event";
19
        }
20
21
        $process = new Process($command);
22
        $process->enableOutput();
23
        $process->setTty(true);
24
25
        return $process->run();
26
    }
27
}
28