Total Complexity | 6 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | final class Operands |
||
17 | { |
||
18 | /** |
||
19 | * @param float|int|numeric-string $number |
||
|
|||
20 | */ |
||
21 | public static function from(float|int|string $number): self |
||
22 | { |
||
23 | return OperandsCache::get($number, static fn(): self => new self($number)); |
||
24 | } |
||
25 | |||
26 | public readonly int|float $n; |
||
27 | public readonly int $i; |
||
28 | public readonly int $v; |
||
29 | public readonly int $w; |
||
30 | public readonly int $f; |
||
31 | public readonly int $t; |
||
32 | public readonly int $e; |
||
33 | |||
34 | /** |
||
35 | * @param float|int|numeric-string $number |
||
36 | */ |
||
37 | private function __construct(float|int|string $number) |
||
64 | } |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return array{ n: float|int, i: int, v: int, w: int, f: int, t: int, e: int } |
||
69 | */ |
||
70 | public function to_array(): array |
||
81 | |||
82 | ]; |
||
85 |