-
Notifications
You must be signed in to change notification settings - Fork 398
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
Add phpstan template annotations to collection/criteria lib objects #1657
Add phpstan template annotations to collection/criteria lib objects #1657
Conversation
Nice. this looks quite useful :) |
Thank you for your encouragement. I noticed that some of the types in our application code didn't resolve well, so I set out to solve the upstream instead of adding a lot of rules to our baseline |
Do you plan on adding more? As your current PR is still a draft. |
I do, and I plan on continuing this work on Thursday 15 October |
Dear @dereuromark, while I was busy with this, I ran into this problem: What would you think is the best way for me to go forward with this PR? I don't want to add type signatures that lie about the parameter or return types, but having |
This is done by adding TReturn and TColl template parameters, unfortunately this is necessary: it reveals complexity that's already present in the code.
I would try to keep the existing param/return as is, and instead focus on adding those as |
…eria-base-classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dereuromark Thank you for your quick reply! I don't fully understand what you mean, and I have tried to be meticulous with not touching existing @var
-annotations or syntax type hints unless absolutely necessary, or where the existing @var
-annotations were incorrect. Can you perhaps point out specific instances that keep you from considering this PR for merging?
@@ -247,7 +256,7 @@ public function exchangeArray($input) | |||
* | |||
* @return array | |||
*/ | |||
public function getArrayCopy() | |||
public function getArrayCopy($keyColumn = null, $usePrefix = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes OnDemandCollection::getArrayCopy
compatible with its parent's ObjectCollection::getArrayCopy
Are you able to rebase and get ci green? Then we can continue. |
IF you write a small PHPStan extension you can reduce the number of ignores to zero. |
To Do: annotations in generated classes