Bug \XF::asVisitor should use phpdoc template for return type hint.

There is a bug in this version
X

Xon

Guest
Using asVisitor destroys the return type for phpstorm static analysis, but with phpdoc templates this can be fixed:

PHP:

Code:
/**
 * 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...

Read more

Continue reading...