| 1 | <?php |
||
| 5 | class Command extends AbstractEntity |
||
| 6 | { |
||
| 7 | const ENTITY_TYPE = 'Command'; |
||
| 8 | |||
| 9 | const PREFIX = '/'; |
||
| 10 | |||
| 11 | const ARGS_SEPARATOR = ' '; |
||
| 12 | |||
| 13 | const PARTS_DELIMITER = '_'; |
||
| 14 | |||
| 15 | const PATTERN = '/^\/[a-zA-Z_]+.*$/'; |
||
| 16 | |||
| 17 | protected $text; |
||
| 18 | |||
| 19 | protected $name; |
||
| 20 | |||
| 21 | protected $args; |
||
| 22 | |||
| 23 | public function __construct(array $data) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return mixed |
||
| 46 | */ |
||
| 47 | public function getName() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | public function getArgs() |
||
| 59 | |||
| 60 | protected function getCommandFromText($text) |
||
| 78 | |||
| 79 | protected function getArgsFromText($command, $text) |
||
| 91 | } |
||
| 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.