From c044db06425af28b2a02091d448860ee1de98f64 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Mon, 27 Jan 2025 00:56:52 +0000 Subject: [PATCH] [BUGFIX] Correct type annotation for `ValueList` components The `Color` class uses this property (`aComponents`) as an associative array. Therefore all related type annotations need `array-key` rather than `int` for the array key type. --- src/Value/CSSFunction.php | 4 ++-- src/Value/Color.php | 6 +++--- src/Value/ValueList.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Value/CSSFunction.php b/src/Value/CSSFunction.php index 82b21e8a4..6f493d63b 100644 --- a/src/Value/CSSFunction.php +++ b/src/Value/CSSFunction.php @@ -20,7 +20,7 @@ class CSSFunction extends ValueList /** * @param string $sName - * @param RuleValueList|array $aArguments + * @param RuleValueList|array $aArguments * @param string $sSeparator * @param int $iLineNo */ @@ -91,7 +91,7 @@ public function setName($sName): void } /** - * @return array + * @return array */ public function getArguments() { diff --git a/src/Value/Color.php b/src/Value/Color.php index 07f11c346..711043443 100644 --- a/src/Value/Color.php +++ b/src/Value/Color.php @@ -16,7 +16,7 @@ class Color extends CSSFunction { /** - * @param array $colorValues + * @param array $colorValues * @param int $lineNumber */ public function __construct(array $colorValues, $lineNumber = 0) @@ -193,7 +193,7 @@ private static function mapRange(float $value, float $fromMin, float $fromMax, f } /** - * @return array + * @return array */ public function getColor() { @@ -201,7 +201,7 @@ public function getColor() } /** - * @param array $colorValues + * @param array $colorValues */ public function setColor(array $colorValues): void { diff --git a/src/Value/ValueList.php b/src/Value/ValueList.php index d332c16fd..4a245ed11 100644 --- a/src/Value/ValueList.php +++ b/src/Value/ValueList.php @@ -15,7 +15,7 @@ abstract class ValueList extends Value { /** - * @var array + * @var array */ protected $aComponents; @@ -25,7 +25,7 @@ abstract class ValueList extends Value protected $sSeparator; /** - * @param array|Value|string $aComponents + * @param array|Value|string $aComponents * @param string $sSeparator * @param int $iLineNo */ @@ -48,7 +48,7 @@ public function addListComponent($mComponent): void } /** - * @return array + * @return array */ public function getListComponents() { @@ -56,7 +56,7 @@ public function getListComponents() } /** - * @param array $aComponents + * @param array $aComponents */ public function setListComponents(array $aComponents): void {