| 1 | <?php |
||
| 11 | class NumberField extends Field |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var string|null |
||
| 15 | */ |
||
| 16 | private $currencyCode; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var NumberStyle|null |
||
| 20 | */ |
||
| 21 | private $numberStyle; |
||
| 22 | |||
| 23 | 19 | public function __construct(?string $key = null, $value = null, ?string $label = null) |
|
| 31 | |||
| 32 | 18 | public function setValue($value): void |
|
| 40 | |||
| 41 | 3 | public function setCurrencyCode(string $currencyCode): void |
|
| 49 | |||
| 50 | 3 | public function setNumberStyle(NumberStyle $numberStyle): void |
|
| 58 | |||
| 59 | 11 | public function getMetadata(): array |
|
| 72 | } |
||
| 73 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: