Conditions | 5 |
Paths | 7 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | private function setSniffProperty(string $sniffCode, string $name, $value) |
||
49 | { |
||
50 | if (isset($sniffs[$sniffCode]) === false) { |
||
|
|||
51 | return; |
||
52 | } |
||
53 | |||
54 | $name = trim($name); |
||
55 | if (is_string($value)) { |
||
56 | $value = trim($value); |
||
57 | } |
||
58 | |||
59 | // Special case for booleans. |
||
60 | if ($value === 'true') { |
||
61 | $value = true; |
||
62 | } elseif ($value === 'false') { |
||
63 | $value = false; |
||
64 | } |
||
65 | |||
66 | $sniffs[$sniffCode]->$name = $value; |
||
67 | } |
||
68 | } |
||
69 |
This check looks for calls to
isset(...)
orempty()
on variables that are yet undefined. These calls will always produce the same result and can be removed.This is most likely caused by the renaming of a variable or the removal of a function/method parameter.