Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
Using asVisitor destroys the return type for phpstorm static analysis, but with phpdoc templates this can be fixed:[CODE=php]/** * Temporarily take an action with the given user considered to be the visitor * * @template T * @param User $user * @param callable(): T $action * @param bool $withLanguage If true, the action will be taken with the given user's language * @return T * * @throws \Exception */public static function asVisitor(User $user, callable $action, bool $withLanguage = false)[/CODE]phpdocs syntax for setting the arguments and return type works with callables and not Closures.There might be a few other locations which also could do with updating for return type from callables/closures.
Using asVisitor destroys the return type for phpstorm static analysis, but with phpdoc templates this can be fixed:
asVisitor
[CODE=php]/**
* Temporarily take an action with the given user considered to be the visitor
*
* @template T
* @param User $user
* @param callable(): T $action
* @param bool $withLanguage If true, the action will be taken with the given user's language
* @return T
* @throws \Exception
*/
public static function asVisitor(User $user, callable $action, bool $withLanguage = false)
[/CODE]
phpdocs syntax for setting the arguments and return type works with callables and not Closures.
There might be a few other locations which also could do with updating for return type from callables/closures.
We use essential cookies to make this site work, and optional cookies to enhance your experience.
See further information and configure your preferences