Closed Missing type hints on various service() methods (already implemented)

Xon

Well-known member
Licensed customer
Affected version
2.3.13
\XF::service() / \XF\App::service() and a few other places have what amounts to this as a the type definition for the method;
PHP:
/**
 * @param $class
 * @param mixed ...$arguments
 *
 * @return mixed
 */
public function service($class, ...$arguments)

This can be replaced with a phpdoc template for type hinting the correct return type;
Code:
/**
 * @template T of AbstractService
 * @param class-string<T> $class
 * @return T
 */
public static function service(string $class, ...$arguments)
 
Last edited:
Back
Top Bottom