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