Conditions | 7 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
62 | protected function getCommandDataFromText($text) |
||
63 | { |
||
64 | $commandOnFirst = Executor::getInstance()->getConfig()->getCommandOnFirst(); |
||
65 | $command = null; |
||
66 | |||
67 | if (!is_string($text) || |
||
68 | !strlen($text) || |
||
69 | ($commandOnFirst === true && $text[0] != self::PREFIX) || |
||
70 | strpos($text, self::PREFIX) === false |
||
71 | ) { |
||
72 | return $command; |
||
73 | } |
||
74 | |||
75 | preg_match(self::PATTERN_COMMAND_DATA, $text, $matches); |
||
76 | |||
77 | if ($matches) { |
||
78 | $matches = array_map('trim', $matches); |
||
79 | } |
||
80 | |||
81 | return $matches; |
||
82 | } |
||
83 | } |
||
84 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.