-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathNumberFormatOptions.php
More file actions
40 lines (36 loc) · 1.4 KB
/
NumberFormatOptions.php
File metadata and controls
40 lines (36 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Code16\Sharp\Dashboard\Widgets\Graph;
use Illuminate\Contracts\Support\Arrayable;
use Spatie\TypeScriptTransformer\Attributes\TypeScript;
#[TypeScript]
readonly class NumberFormatOptions implements Arrayable
{
/**
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
*/
public function __construct(
public ?string $style = null,
public ?string $currency = null,
public ?string $currencyDisplay = null,
public ?string $currencySign = null,
public ?bool $useGrouping = null,
public ?int $minimumIntegerDigits = null,
public ?int $minimumFractionDigits = null,
public ?int $maximumFractionDigits = null,
public ?int $minimumSignificantDigits = null,
public ?int $maximumSignificantDigits = null,
public ?string $notation = null,
public ?string $compactDisplay = null,
public ?string $signDisplay = null,
public ?string $unit = null,
public ?string $unitDisplay = null,
public ?string $roundingMode = null,
public ?int $roundingPriority = null,
public ?int $roundingIncrement = null,
public ?int $trailingZeroDisplay = null,
) {}
public function toArray(): array
{
return array_filter(get_object_vars($this), fn ($value) => $value !== null);
}
}