| 1 | <?php |
||
| 19 | class Token extends Base |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Generate a random token with different methods: openssl or /dev/urandom or fallback to uniqid(). |
||
| 23 | * |
||
| 24 | * @static |
||
| 25 | * |
||
| 26 | * @return string Random token |
||
| 27 | */ |
||
| 28 | public static function getToken() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Generate and store a CSRF token in the current session. |
||
| 35 | * |
||
| 36 | * @return string Random token |
||
| 37 | */ |
||
| 38 | public function getCSRFToken() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Check if the token exists for the current session (a token can be used only one time). |
||
| 52 | * |
||
| 53 | * @param string $token CSRF token |
||
| 54 | * |
||
| 55 | * @return bool |
||
| 56 | */ |
||
| 57 | public function validateCSRFToken($token) |
||
| 67 | } |
||
| 68 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.