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
We are evaluating upgrading to 4.5 and the new *Query classes. This is easy with the exception of find() which still lists Query in the type-hint and return type.
Can we change the find() return type to SelectQuery or at least change the type hint?
Since SelectQuery is a subclass of Query both approaches should be backward compatible.
CakePHP Version
4.5.0
The text was updated successfully, but these errors were encountered:
Changing the return type as you suggest won't be backwards compatible if someone has overridden Table::find() and using Cake\ORM\Query as the return type.
Changing the return type as you suggest won't be backwards compatible if someone has overridden Table::find() and using Cake\ORM\Query as the return type.
You are right. I haven't considered that. Can we at least change the type hint?
Changing the documented return type will result in phpstan errors because the documented type and the defined type diverge. We could suppress those warning in cakephp, but I'm not sure if those errors will spill into application code too.
Description
We are evaluating upgrading to 4.5 and the new *Query classes. This is easy with the exception of find() which still lists Query in the type-hint and return type.
Can we change the find() return type to SelectQuery or at least change the type hint?
Since SelectQuery is a subclass of Query both approaches should be backward compatible.
CakePHP Version
4.5.0
The text was updated successfully, but these errors were encountered: