| Conditions | 5 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 60 | protected function getCommandFromText($text) |
||
| 61 | { |
||
| 62 | $command = null; |
||
| 63 | |||
| 64 | if (!is_string($text) || !strlen($text) || $text[0] !== static::PREFIX) { |
||
| 65 | return $command; |
||
| 66 | } |
||
| 67 | |||
| 68 | if (strpos($text, static::ARGS_SEPARATOR) !== false) { |
||
| 69 | $parts = explode(static::ARGS_SEPARATOR, $text); |
||
| 70 | |||
| 71 | $text = trim($parts[0]); |
||
| 72 | } |
||
| 73 | |||
| 74 | $command = trim(substr($text, 1, strlen($text) - 1)); |
||
| 75 | |||
| 76 | return $command; |
||
| 77 | } |
||
| 78 | |||
| 92 |
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.