-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix all problems from PHPStan #2
base: main
Are you sure you want to change the base?
Conversation
BTW Tests were moved from |
src/EventQuery.php
Outdated
@@ -137,9 +137,11 @@ protected function init_end_date(array $params, DateTimeImmutable $start) : Date | |||
* Get the results for this EventQuery as a collection of zero or more Events | |||
* | |||
* @internal | |||
* @return array |
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.
@acobster Just put list<\Timber\Post>
here.
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.
it means array<int, \Timber\Post>
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.
Good to know, but array<int, \Timber\Post>
is not quite correct, is it? Wouldn't array<\Timber\Post>
be better?
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.
Oh yes.
Unfortunately the return type for |
Okay!! |
Still seems to be already an array thus not possible to call that method on it. |
I think it's complaining because of the Timber type annotation return $posts ? $posts->to_array() : []; ...but PHPStan still considers it possible it will return If posts are found, |
I see!! So |
Here is the Anti-Problem Laser Gun 🔫 Now it is very easy to resolve these kind of problems. |
All things fixed, even broken greg.php 👍
@acobster Please help me in the last one: