1 | <?php |
||
28 | class StartGitterBot extends Command |
||
29 | { |
||
30 | /** |
||
31 | * The name and signature of the console command. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $signature = 'gitter:listen {room}'; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * The console command description. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $description = 'Start gitter bot thread for target room.'; |
||
44 | |||
45 | |||
46 | /** |
||
47 | * @var Container |
||
48 | */ |
||
49 | protected $container; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $pid; |
||
55 | |||
56 | |||
57 | /** |
||
58 | * Execute the console command. |
||
59 | * |
||
60 | * @param Repository $config |
||
61 | * @param Container $container |
||
62 | * |
||
63 | * @return mixed |
||
64 | * @throws \InvalidArgumentException |
||
65 | * @throws \RuntimeException |
||
66 | * @throws \LogicException |
||
67 | * @throws \Exception |
||
68 | */ |
||
69 | public function handle(Repository $config, Container $container) |
||
81 | |||
82 | /** |
||
83 | * Create pid file |
||
84 | */ |
||
85 | protected function makePidFile() |
||
90 | |||
91 | /** |
||
92 | * Delete pid file |
||
93 | */ |
||
94 | protected function removePidFile() |
||
100 | } |
||
101 |
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.