Skip to content

[BUGFIX] Correct type annotation for ValueList components #826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Value/CSSFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CSSFunction extends ValueList

/**
* @param string $sName
* @param RuleValueList|array<int, Value|string> $aArguments
* @param RuleValueList|array<array-key, Value|string> $aArguments
* @param string $sSeparator
* @param int $iLineNo
*/
Expand Down Expand Up @@ -91,7 +91,7 @@ public function setName($sName): void
}

/**
* @return array<int, Value|string>
* @return array<array-key, Value|string>
*/
public function getArguments()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Value/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class Color extends CSSFunction
{
/**
* @param array<int, Value|string> $colorValues
* @param array<array-key, Value|string> $colorValues
* @param int $lineNumber
*/
public function __construct(array $colorValues, $lineNumber = 0)
Expand Down Expand Up @@ -193,15 +193,15 @@ private static function mapRange(float $value, float $fromMin, float $fromMax, f
}

/**
* @return array<int, Value|string>
* @return array<array-key, Value|string>
*/
public function getColor()
{
return $this->aComponents;
}

/**
* @param array<int, Value|string> $colorValues
* @param array<array-key, Value|string> $colorValues
*/
public function setColor(array $colorValues): void
{
Expand Down
8 changes: 4 additions & 4 deletions src/Value/ValueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
abstract class ValueList extends Value
{
/**
* @var array<int, Value|string>
* @var array<array-key, Value|string>
*/
protected $aComponents;

Expand All @@ -25,7 +25,7 @@ abstract class ValueList extends Value
protected $sSeparator;

/**
* @param array<int, Value|string>|Value|string $aComponents
* @param array<array-key, Value|string>|Value|string $aComponents
* @param string $sSeparator
* @param int $iLineNo
*/
Expand All @@ -48,15 +48,15 @@ public function addListComponent($mComponent): void
}

/**
* @return array<int, Value|string>
* @return array<array-key, Value|string>
*/
public function getListComponents()
{
return $this->aComponents;
}

/**
* @param array<int, Value|string> $aComponents
* @param array<array-key, Value|string> $aComponents
*/
public function setListComponents(array $aComponents): void
{
Expand Down