| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | 3 | private function extractValueFromDataArray(array $data, array $path) |
|
| 51 | { |
||
| 52 | /** @var string $key */ |
||
| 53 | 3 | $key = array_shift($path); |
|
| 54 | |||
| 55 | /** @var mixed $value */ |
||
| 56 | 3 | $value = null; |
|
| 57 | |||
| 58 | 3 | if (isset($data[$key])) { |
|
| 59 | 3 | $value = $data[$key]; |
|
| 60 | |||
| 61 | 3 | if (!empty($path)) { |
|
| 62 | $value = $this->extractValueFromDataArray($value, $path); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | 3 | return $value; |
|
| 67 | } |
||
| 68 | |||
| 70 |
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.