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
AbstractRestfulController::patch has a typehint of @return array rather than @return mixed (which the other actions have).
Current behavior
This issue is highlighted by static analysis tools like PHPStan when you extend the class. If you try to set a return type of e.g. JsonModel or ResponseInterface, PHPStan (rightly) complains that the return type isn't compatible.
How to reproduce
N/A, it's just documentation
Expected behavior
I think it should return mixed, like the other methods. I'm happy to create a PR for this, but wanted to check I hadn't missed something first.
The text was updated successfully, but these errors were encountered:
Following intended use of the return values in AbstractController and its descendants, array was never a valid return type as it is expected that ViewModel would be returned, with array just a convenience shortcut for ViewModel, while Response object as a return value would short circuit controller's dispatch event and would prevent render event entirely.
Bug Report
Summary
AbstractRestfulController::patch
has a typehint of@return array
rather than@return mixed
(which the other actions have).Current behavior
This issue is highlighted by static analysis tools like PHPStan when you extend the class. If you try to set a return type of e.g.
JsonModel
orResponseInterface
, PHPStan (rightly) complains that the return type isn't compatible.How to reproduce
N/A, it's just documentation
Expected behavior
I think it should return
mixed
, like the other methods. I'm happy to create a PR for this, but wanted to check I hadn't missed something first.The text was updated successfully, but these errors were encountered: