| 1 | <?php namespace Arcanesoft\Core\Entities; |
||
| 9 | class Yon |
||
| 10 | { |
||
| 11 | /* ----------------------------------------------------------------- |
||
| 12 | | Constants |
||
| 13 | | ----------------------------------------------------------------- |
||
| 14 | */ |
||
| 15 | |||
| 16 | const YES = 'yes'; |
||
| 17 | const NO = 'no'; |
||
| 18 | |||
| 19 | /* ----------------------------------------------------------------- |
||
| 20 | | All |
||
| 21 | | ----------------------------------------------------------------- |
||
| 22 | */ |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get all. |
||
| 26 | * |
||
| 27 | * @return \Illuminate\Support\Collection |
||
| 28 | */ |
||
| 29 | public static function all() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get all keys. |
||
| 39 | * |
||
| 40 | * @return \Illuminate\Support\Collection |
||
| 41 | */ |
||
| 42 | public static function keys() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get a translated YoN status. |
||
| 49 | * |
||
| 50 | * @param string|boolean $key |
||
| 51 | * @param null $default |
||
| 52 | * |
||
| 53 | * @return string|null |
||
| 54 | */ |
||
| 55 | public static function get($key, $default = null) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Parse the key. |
||
| 62 | * |
||
| 63 | * @param string|boolean $key |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | private static function parseKey($key) |
||
| 73 | } |
||
| 74 |
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: