Skip to content

Commit

Permalink
Add array type-hint to text attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasKuehneEllerhold committed Nov 13, 2023
1 parent fe658ce commit 4c756e4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/View/Helper/NumberFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class NumberFormat extends AbstractHelper

/**
* Text attributes.
*
* @var array<int, string>
*/
protected array $textAttributes = [];

Expand All @@ -59,7 +61,8 @@ class NumberFormat extends AbstractHelper
/**
* Format a number
*
* @param int|float $number
* @param int|float $number
* @param array<int, string> $textAttributes
*/
public function __invoke(
$number,
Expand Down Expand Up @@ -145,9 +148,9 @@ public function getFormatStyle(): int
/**
* Set format type to use instead of the default
*/
public function setFormatType($formatType): self
public function setFormatType(?int $formatType): self
{
$this->formatType = (int) $formatType;
$this->formatType = $formatType;
return $this;
}

Expand Down Expand Up @@ -235,11 +238,17 @@ public function getLocale(): string
return $this->locale;
}

/**
* @return array<int, string>
*/
public function getTextAttributes(): array
{
return $this->textAttributes;
}

/**
* @param array<int, string> $textAttributes
*/
public function setTextAttributes(array $textAttributes): self
{
$this->textAttributes = $textAttributes;
Expand Down

0 comments on commit 4c756e4

Please sign in to comment.