| 1 | <?php |
||
| 5 | class Generator |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The token generator function. |
||
| 9 | * |
||
| 10 | * @var callable |
||
| 11 | */ |
||
| 12 | protected static $handler; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Get the callback function. |
||
| 16 | * |
||
| 17 | * @return callable |
||
| 18 | */ |
||
| 19 | public static function handler() |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Register a custom generator handler. |
||
| 32 | * |
||
| 33 | * @param callable $handler |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | public static function extend(callable $handler) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Generate a new token value. |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public static function generate() |
||
| 50 | } |
||
| 51 |