Closed ppaulis closed 2 years ago
Would you be able to send a patch/proposal? Easier to review what you have in mind on a diff.
@Ocramius I can do that :+1: I'll get back to you asap.
@Ocramius I opened the PR #28. This is for discussion only because of the BC break it causes in the api-tools-admin
repository. If you think this is worth pursuing, let me know how you'd like to handle it :-)
Handled in #28
Bug Report
Current behaviour
In: https://github.com/laminas-api-tools/api-tools-rest/blob/dde0d361e655a85bd07c150eb56976d6d6ac70ea/src/AbstractResourceListener.php#L183
the
fetchAll()
receives either an instance ofLaminas\Stdlib\Parameters
or anarray
.The definition of the generated method stubs (and the parent method) is:
Imho, in addition to problems with tools like PHPStan, this leads to all sorts of misunderstandings when trying to treat
$params
as an array. E.g. :generates :
Expected behaviour
Wouldn't it be better to enforce a strict typing on
Laminas\Stdlib\Parameters
? And let the user decide if$params
should be transformed into an array?Thanks and greetings, Pascal