| 1 | <?php namespace G2R\Gitlab; |
||
| 8 | class HookResolver |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Load a gitlab or gitlab CI webhook handler |
||
| 12 | * |
||
| 13 | * @param $data |
||
| 14 | * |
||
| 15 | * @return GitlabCiHook|GitlabHook |
||
| 16 | */ |
||
| 17 | public static function load($data) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Check if the hook content has a valid object kind |
||
| 34 | */ |
||
| 35 | private static function objectValidation($data) |
||
| 49 | } |
||
| 50 |
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: