1 | <?php |
||
11 | class ExampleIRCBot extends \PHPDaemon\Core\AppInstance |
||
12 | { |
||
13 | public $client; |
||
14 | public $conn; |
||
15 | |||
16 | /** |
||
17 | * Constructor. |
||
18 | * @return void |
||
19 | */ |
||
20 | public function init() |
||
26 | |||
27 | /** |
||
28 | * Called when the worker is ready to go. |
||
29 | * @return void |
||
30 | */ |
||
31 | public function onReady() |
||
38 | |||
39 | public function connect() |
||
62 | |||
63 | /** |
||
64 | * Called when worker is going to update configuration. |
||
65 | * @return void |
||
66 | */ |
||
67 | public function onConfigUpdated() |
||
74 | |||
75 | /** |
||
76 | * Called when application instance is going to shutdown. |
||
77 | * @return boolean Ready to shutdown? |
||
78 | */ |
||
79 | public function onShutdown() |
||
86 | |||
87 | /** |
||
88 | * Setting default config options |
||
89 | * Overriden from AppInstance::getConfigDefaults |
||
90 | * Uncomment and return array with your default options |
||
91 | * @return array|false |
||
92 | */ |
||
93 | protected function getConfigDefaults() |
||
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.