Passed
Push — master ( abce15...80de3b )
by Gaetano
10:06
created

Process   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forceSigchildEnabled() 0 3 1
A isSigchildEnabled() 0 7 2
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\Core\Process;
4
5
use Symfony\Component\Process\Process as BaseProcess;
6
7
/**
8
 * Allow to force Symfony Process objects to trust that php has been compiled with --enable-sigchild even when the
9
 * options used to compile php are not visible to phpinfo, such as on Debian/Ubuntu
10
 */
11
class Process extends BaseProcess
12
{
13
    static $forceSigchildEnabled = null;
14
15
    public static function forceSigchildEnabled($force)
16
    {
17
        self::$forceSigchildEnabled = (bool) $force;
18
    }
19
20
    protected function isSigchildEnabled()
21
    {
22
        if (null !== self::$forceSigchildEnabled) {
23
            return self::$forceSigchildEnabled;
24
        }
25
26
        return parent::isSigchildEnabled();
27
    }
28
}
29