aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-04-15 01:19:22 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-15 01:19:22 +0200
commita19b56064d74ae871abd52903778e0d5c35af896 (patch)
treefdc0f2cadc8171c466de34d1d30adab01a738c71 /app/Models/Feed.php
parentb8662f88995df2cbae655d4efe8f414eb3872e5e (diff)
PHPstan level 6 for Category.php (#5298)
* PHPstan level 6 for Category.php * Fix a few things * Minor fixes * A few more fixes --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 0b16bc796..447445d46 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -199,12 +199,15 @@ class FreshRSS_Feed extends Minz_Model {
return $this->ttl;
}
- /** @return mixed attribute (if $key is not blank) or array of attributes, not HTML-encoded */
- public function attributes($key = '') {
- if ($key == '') {
+ /**
+ * @phpstan-return ($key is non-empty-string ? mixed : array<string,mixed>)
+ * @return array<string,mixed>|mixed|null
+ */
+ public function attributes(string $key = '') {
+ if ($key === '') {
return $this->attributes;
} else {
- return isset($this->attributes[$key]) ? $this->attributes[$key] : null;
+ return $this->attributes[$key] ?? null;
}
}
@@ -330,7 +333,7 @@ class FreshRSS_Feed extends Minz_Model {
$this->mute = $value < self::TTL_DEFAULT;
}
- /** @param mixed $value Value, not HTML-encoded */
+ /** @param string|array<mixed>|bool|int|null $value Value, not HTML-encoded */
public function _attributes(string $key, $value) {
if ($key == '') {
if (is_string($value)) {