Updated AbstractActionController::indexAction return type to reflect real usage #5
Closed
1 task done
Labels
Bug
Something isn't working
When running static analysis against a simple userland controller like:
That do NOT provide the return type, neither with PHP 7.1 return type nor via DocBlock, tools like PHPstan use inherited docs and report:
Of course users should add return types, but it would result in requiring a massive code update without real benefits, since the default behavior of Zend\Mvc framework is to allow:
null
from\Zend\Mvc\View\Http\CreateViewModelListener::createViewModelFromNull
listenerarray
from\Zend\Mvc\View\Http\CreateViewModelListener::createViewModelFromArray
listenerViewModel
from\Zend\Mvc\View\Http\DefaultRenderingStrategy::render
listenerResponseInterface
from\Zend\Mvc\SendResponseListener::sendResponse
listenerThis change only applies to
indexAction
since I guess its usage is widespread:notFoundAction
is untouched as users that override it are, IMHO, already advanced ones.Ping @Ocramius you type lover ❤️
Reference: https://github.com/Slamdunk/phpstan-zend-framework/issues/5
Originally posted by @Slamdunk at zendframework/zend-mvc#312
The text was updated successfully, but these errors were encountered: