From 0c2df12992c92327c67c5db19626eae09a2915f4 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Mon, 15 Apr 2024 18:02:22 +0200 Subject: [PATCH] Fix return for `getValues()` --- .github/phpstan.neon | 3 +++ src/Mods/Element/Xml/Element.php | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/phpstan.neon b/.github/phpstan.neon index d5fae57..6fc5aad 100644 --- a/.github/phpstan.neon +++ b/.github/phpstan.neon @@ -1,4 +1,7 @@ parameters: + ignoreErrors: + - '#PHPDoc tag @var for property Slub\\Mods\\Element\\Xml\\Element::\$values with type array\|false is not subtype of native type array\.#' + - '#PHPDoc tag @return with type array\|false is not subtype of native type array\.#' level: 5 paths: - ../src/ diff --git a/src/Mods/Element/Xml/Element.php b/src/Mods/Element/Xml/Element.php index a186476..aec70a3 100644 --- a/src/Mods/Element/Xml/Element.php +++ b/src/Mods/Element/Xml/Element.php @@ -64,12 +64,13 @@ public function exists(): bool } /** - * Get the value of the queried element + * Get the array of values of the queried element. * * @access public * - * @return array|false + * @return array|false array if element exists, false otherwise */ + // TODO: change return type after upgrade to PHP 8.x public function getValues(): array { return $this->values;