| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function store($handler, $value = []) |
||
| 41 | { |
||
| 42 | $value = is_array($value) |
||
| 43 | ? $value |
||
| 44 | : array_slice(func_get_args(), 1); |
||
| 45 | |||
| 46 | if ($handler instanceof \Closure) { |
||
| 47 | self::$queueHandler->add(new FunctionInvoker($handler), $value); |
||
| 48 | } else { |
||
| 49 | self::$queueHandler->add(new MethodInvoker($handler), $value); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 63 |
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
SomeClassto useselfinstead: