diff --git a/README.md b/README.md index 26a49c5..db2b8ed 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,8 @@ catch (\Delight\Auth\TooManyRequestsException $e) { } ``` +**Note:** The anonymous callback function is a [closure](http://php.net/manual/en/functions.anonymous.php). Thus, besides its own parameters, only [superglobals](http://php.net/manual/en/language.variables.superglobals.php) like `$_GET`, `$_POST`, `$_COOKIE` and `$_SERVER` are available inside. For any other variable from the parent scope, you need to explicitly make a copy available inside by adding a `use` clause after the parameter list. + The username in the third parameter is optional. You can pass `null` there if you don’t want to manage usernames. If you want to enforce unique usernames, on the other hand, simply call `registerWithUniqueUsername` instead of `register`, and be prepared to catch the `DuplicateUsernameException`. @@ -261,6 +263,8 @@ catch (\Delight\Auth\TooManyRequestsException $e) { } ``` +**Note:** The anonymous callback function is a [closure](http://php.net/manual/en/functions.anonymous.php). Thus, besides its own parameters, only [superglobals](http://php.net/manual/en/language.variables.superglobals.php) like `$_GET`, `$_POST`, `$_COOKIE` and `$_SERVER` are available inside. For any other variable from the parent scope, you need to explicitly make a copy available inside by adding a `use` clause after the parameter list. + You should build an URL with the selector and token and send it to the user, e.g.: ```php @@ -395,6 +399,8 @@ catch (\Delight\Auth\TooManyRequestsException $e) { } ``` +**Note:** The anonymous callback function is a [closure](http://php.net/manual/en/functions.anonymous.php). Thus, besides its own parameters, only [superglobals](http://php.net/manual/en/language.variables.superglobals.php) like `$_GET`, `$_POST`, `$_COOKIE` and `$_SERVER` are available inside. For any other variable from the parent scope, you need to explicitly make a copy available inside by adding a `use` clause after the parameter list. + For email verification, you should build an URL with the selector and token and send it to the user, e.g.: ```php @@ -443,6 +449,8 @@ catch (\Delight\Auth\TooManyRequestsException $e) { } ``` +**Note:** The anonymous callback function is a [closure](http://php.net/manual/en/functions.anonymous.php). Thus, besides its own parameters, only [superglobals](http://php.net/manual/en/language.variables.superglobals.php) like `$_GET`, `$_POST`, `$_COOKIE` and `$_SERVER` are available inside. For any other variable from the parent scope, you need to explicitly make a copy available inside by adding a `use` clause after the parameter list. + Usually, you should build an URL with the selector and token and send it to the user, e.g. as follows: ```php