-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Update SelectQuery return typehints to match updated ResultSetInterface #18925
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
base: 5.x
Are you sure you want to change the base?
Conversation
How to re-run those CI/CD checks? As coding standard did fail to fetch phpstan binary 👀 |
Looks good. |
@kolorafa you could use the existing TSubject (https://github.com/cakephp/cakephp/pull/18925/files#diff-1ab7f7c61167076737415b6cbabb97d5d6a0e70e5adec87dc763135f8a1117b1L47) |
@rochamarcelo You mean like changing |
@kolorafa yes, also for |
Sorry for the delay. Thinking if I should change into the same for into because in theory ResultSetInterface could contain any type/structure if formatters created and returing god-knowns-what |
The issue is because we allow "array" as a TSubject
places that would need change/assert to allow arrays as a return values: cakephp/src/ORM/Association/HasMany.php Lines 555 to 556 in 50d106c
cakephp/src/ORM/Association/BelongsToMany.php Lines 618 to 619 in 50d106c
cakephp/src/ORM/Association/DependentDeleteHelper.php Lines 56 to 57 in 50d106c
Question, should I remove allowing array as a returned type, or update the code to assert/check if the deleted value is actually EntityInterface and throw CakeException if it's not? Or better revert/skip last changes and skip them for now, as it might be better to introduce this change not in patch release but minor release? |
Ignore TSubject for now since it is causing more issues. Maybe we can use it in the future. |
fbafc02
to
28ed3f0
Compare
Froce-pushed branch without the last commit. I would also like those changes to be introduced, but I agree that it does generate issues that should be introduced in patch release. So this PR only fixes the bad/missing second template for typehinting issue, and should be ready to merge. |
28ed3f0
to
9327269
Compare
Rebased :) |
In relation to changes to ResultSetInterface
Change to SelectQuery @return interfaces to include both required template variables
related conversation: #18867
change:
923620b
https://github.com/cakephp/cakephp/pull/18806/files#diff-ef7a1551c15fd8984eb0cf77bd248348055e104689d622609e671f1974e7c53e