From 44a782e71d9e08aa3befbcf3189e247425351b52 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Fri, 26 Jun 2026 12:54:08 +0200 Subject: [PATCH] [BUGFIX] Fix typing and check in `Element` class --- src/Mods/Element/Xml/Element.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mods/Element/Xml/Element.php b/src/Mods/Element/Xml/Element.php index 729af95..1ce45f5 100644 --- a/src/Mods/Element/Xml/Element.php +++ b/src/Mods/Element/Xml/Element.php @@ -22,9 +22,9 @@ class Element /** * @access protected - * @var static[]|false|null + * @var \SimpleXMLElement[]|false|null */ - protected array $values; // @phpstan-ignore-line + protected mixed $values; /** * @access protected @@ -60,7 +60,7 @@ public function __construct(\SimpleXMLElement $xml, string $xpath) */ public function exists(): bool { - return $this->values != false && $this->values != null; + return $this->values !== false && $this->values !== null && count($this->values) > 0; } /** @@ -83,9 +83,9 @@ public function getValues(): array * * @access public * - * @return mixed + * @return \SimpleXMLElement|null */ - public function getFirstValue() + public function getFirstValue(): ?\SimpleXMLElement { if ($this->exists()) { return $this->values[0];