1 | <?php |
||
5 | class RequestHandler |
||
6 | { |
||
7 | /** |
||
8 | * @var Singleton The reference to *Singleton* instance of this class |
||
9 | */ |
||
10 | private static $instance; |
||
11 | |||
12 | private $request_data = array(); |
||
13 | |||
14 | const NONCE_ACTION = 'amarkal_settings'; |
||
15 | |||
16 | /** |
||
17 | * Returns the *Singleton* instance of this class. |
||
18 | * |
||
19 | * @return Singleton The *Singleton* instance. |
||
20 | */ |
||
21 | public static function get_instance() |
||
29 | |||
30 | public function init() |
||
35 | |||
36 | public function save_settings() |
||
43 | |||
44 | public function reset_settings() |
||
51 | |||
52 | private function get_request_child_page() |
||
60 | |||
61 | private function set_request_data() |
||
77 | } |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: