Creating a reflection class of AbstractConsoleController results in a wrong number of @param annotations beeing parsed #21
Description
Trying to call \Zend\Server\Reflection::reflectClass
for a class that extends \Zend\Mvc\Console\Controller\AbstractConsoleController
seems to always result in the following exception:
Variable number of arguments is not supported for services (except optional parameters). Number of function arguments must correspond to actual number of arguments described in a docblock.
This seems to be because of the @inheritdoc of \Zend\Mvc\Console\Controller\AbstractConsoleController::dispatch
and the dispatch
functions of the parent classes. The resulting comment that is parsed looks like this:
/**
* {@inheritdoc}
* {@inheritdoc}
* Dispatch a request
*
* @events dispatch.pre, dispatch.post
* @param Request $request
* @param null|Response $response
* @return Response|mixed
* Dispatch a request
*
* @param RequestInterface $request
* @param null|ResponseInterface $response
* @return Response|mixed
*/
There are 4 @param annotations in this text, and all 4 get parsed (see vendor/zendframework/zend-server/src/Reflection/AbstractFunction.php:284
) while the actual function only has 2 parameters, resulting in the above mentioned exception.
The docblock comment seems to come from \Zend\Stdlib\DispatchableInterface::dispatch
and \Zend\Mvc\Controller\AbstractController::dispatch
, but I think the problem is not the Docblock itself but instead the way it is parsed. If more information is necessary, feel free to ask, I can reproduce the error without a problem.