1 | <?php |
||
11 | class ReferenceNumber |
||
12 | { |
||
13 | /** |
||
14 | * Get the pool to use based on the type of prefix hash. |
||
15 | * @param string $type |
||
16 | * @return string |
||
17 | */ |
||
18 | private static function getPool($type = 'alnum') |
||
46 | |||
47 | /** |
||
48 | * Generate a random secure crypt figure. |
||
49 | * @param int $min |
||
50 | * @param int $max |
||
51 | * @return int |
||
52 | */ |
||
53 | private static function secureCrypt($min, $max) |
||
72 | |||
73 | /** |
||
74 | * Finally, generate a hashed token. |
||
75 | * @param int $length |
||
76 | * @return string |
||
77 | */ |
||
78 | public static function getHashedToken($length = 25) |
||
88 | } |
||
89 |
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: