You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In presenter methods like actionXYZ or renderXYZ I can't use iterable parameter type-hint, because if I put argument type array or ArrayHash (or another object that implements interface Traversable) I get InvalidLinkException (if I try create link) or BadRequestException (if I try call method direct with typing URL) with this message:
Argument $data passed to App\Presenters\SamplePresenter::actionSample() must be iterable, Nette\Utils\ArrayHash given.
respectively
Argument $data passed to App\Presenters\SamplePresenter::actionSample() must be iterable, array given.
Exception is thrown from Nette\Application\UI\ComponentReflection after ComponentReflection ::convertType returns false
I expect true return value from Nette\Application\UI\ComponentReflection::convertType in accordance with PHP documentation:
Iterable is a pseudo-type introduced in PHP 7.1. It accepts any array or object implementing the Traversable interface. Both of these types are iterable using foreach and can be used with yield from within a generator.
Version: 2.4.12
Bug Description
In presenter methods like actionXYZ or renderXYZ I can't use
iterable
parameter type-hint, because if I put argument typearray
orArrayHash
(or another object that implements interfaceTraversable
) I getInvalidLinkException
(if I try create link) orBadRequestException
(if I try call method direct with typing URL) with this message:Argument $data passed to App\Presenters\SamplePresenter::actionSample() must be iterable, Nette\Utils\ArrayHash given.
respectively
Argument $data passed to App\Presenters\SamplePresenter::actionSample() must be iterable, array given.
Exception is thrown from
Nette\Application\UI\ComponentReflection
afterComponentReflection ::convertType
returnsfalse
Steps To Reproduce
Expected Behavior
I expect
true
return value fromNette\Application\UI\ComponentReflection::convertType
in accordance with PHP documentation:http://php.net/manual/en/language.types.iterable.php
The text was updated successfully, but these errors were encountered: