| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | protected function findGit() |
||
| 37 | { |
||
| 38 | $proc = proc_open( |
||
| 39 | 'git --version', |
||
| 40 | array( |
||
| 41 | 0 => array('pipe', 'r'), |
||
| 42 | 1 => array('pipe', 'w'), |
||
| 43 | 2 => array('pipe', 'w') |
||
| 44 | ), $pipes |
||
| 45 | ); |
||
| 46 | |||
| 47 | $res = preg_match('/^git version ([0-9\.]+)(.+)?\n$/', stream_get_contents($pipes[1]), $vars); |
||
| 48 | $rtn = proc_close($proc); |
||
|
|
|||
| 49 | if (!$res) { |
||
| 50 | return array(false, 'none'); |
||
| 51 | } |
||
| 52 | $version = $vars[1]; |
||
| 53 | |||
| 54 | return array(true, $version); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.