New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: ResultsetInterface missing methods #16534
Comments
I strongly agree for this one. I was about to open another issue but it seems to be exactly my problem as well. Static code analyzers such as Psalm, PHPStan will report false-positive error when iterating results from "Model::find()" requests.
Using the current Phalcon version 5.6.2, just to make the static code analyzers happy, we have to do unnecessary ignores or assertations like this: $users = User::find();
assert($users instanceof \Iterator);
foreach ($users as $user) {
// ...
} If it's not possible to alter the |
Describe the bug
The ResultInterface is missing methods that are available to all result sets. Simple and Complex both only extend Resultset. Resultset is the only Class that implements ResultsetInterface. Therefor all methods from Resultset should also be in ResultsetInterface. For example currently the
count()
method is missing. So to make static code analyzer happy, we need to add a phpdoc overwrite of the type, or usecount($model->toArray())
.To Reproduce
Read code
Expected behavior
In general all Interfaces should be checked for missing methods.
Screenshots
Details
The text was updated successfully, but these errors were encountered: