From a19b56064d74ae871abd52903778e0d5c35af896 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Sat, 15 Apr 2023 01:19:22 +0200 Subject: 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 Co-authored-by: Alexandre Alapetite --- app/Models/Entry.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index be31387c3..791853aca 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -363,17 +363,17 @@ HTML; /** * @phpstan-return ($key is non-empty-string ? mixed : array) - * @return array|mixed + * @return array|mixed|null */ public function attributes(string $key = '') { - if ($key == '') { + if ($key === '') { return $this->attributes; } else { - return isset($this->attributes[$key]) ? $this->attributes[$key] : null; + return $this->attributes[$key] ?? null; } } - /** @param string|array|bool|int|null $value */ + /** @param string|array|bool|int|null $value Value, not HTML-encoded */ public function _attributes(string $key, $value): void { if ($key == '') { if (is_string($value)) { -- cgit v1.2.3