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
phpstan-8 for category class #5434
phpstan-8 for category class #5434
Conversation
app/Models/Category.php
Outdated
/** @var array<FreshRSS_Feed>|null */ | ||
/** @var array<FreshRSS_Feed> */ |
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.
I am not sure this is a good solution, as we need to test for nullability below: if ($this->feeds === null)
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.
got to matermost ?
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.
$feedDAO->listByCategory($this->id()); return always a array() of FreshRSS_Feed
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.
See below, line 109: if ($this->feeds === null)
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.
* @throws Minz_ConfigurationNamespaceException | ||
* @throws Minz_PDOConnectionException | ||
*/ | ||
|
||
public function feeds(): array { | ||
if ($this->feeds === null) { |
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 is the line testing for null
* phpstan-8 for category class * Another approach to nullable FreshRSS#5434 (comment) --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Changes proposed in this pull request:
Pull request checklist: