|
24 | 24 | * |
25 | 25 | * @internal This class is not part of the public API, and may change without notice. |
26 | 26 | */ |
27 | | -final class UnionType implements Stringable |
| 27 | +final readonly class UnionType implements Stringable |
28 | 28 | { |
29 | | - public readonly bool $allowsInt; |
| 29 | + public bool $allowsInt; |
30 | 30 |
|
31 | | - public readonly bool $allowsFloat; |
| 31 | + public bool $allowsFloat; |
32 | 32 |
|
33 | | - public readonly bool $allowsString; |
| 33 | + public bool $allowsString; |
34 | 34 |
|
35 | | - public readonly bool $allowsTrue; |
| 35 | + public bool $allowsTrue; |
36 | 36 |
|
37 | | - public readonly bool $allowsFalse; |
| 37 | + public bool $allowsFalse; |
38 | 38 |
|
39 | | - public readonly bool $allowsNull; |
| 39 | + public bool $allowsNull; |
40 | 40 |
|
41 | | - public readonly bool $allowsRawArray; |
| 41 | + public bool $allowsRawArray; |
42 | 42 |
|
43 | | - public readonly bool $allowsRawObject; |
| 43 | + public bool $allowsRawObject; |
44 | 44 |
|
45 | | - public readonly bool $allowsMixed; |
| 45 | + public bool $allowsMixed; |
46 | 46 |
|
47 | 47 | /** |
48 | 48 | * @var ClassType[] |
49 | 49 | */ |
50 | | - public readonly array $classTypes; |
| 50 | + public array $classTypes; |
51 | 51 |
|
52 | 52 | /** |
53 | 53 | * At most one enum type per backed type (int, string) is allowed in a union. |
54 | 54 | * |
55 | 55 | * @var EnumType[] |
56 | 56 | */ |
57 | | - public readonly array $enumTypes; |
| 57 | + public array $enumTypes; |
58 | 58 |
|
59 | 59 | /** |
60 | 60 | * At most one ArrayType is allowed in a union. |
61 | 61 | */ |
62 | | - public readonly ?ArrayType $arrayType; |
| 62 | + public ?ArrayType $arrayType; |
63 | 63 |
|
64 | 64 | /** |
65 | 65 | * @param (SimpleType|ClassType|EnumType|ArrayType)[] $types |
66 | 66 | * |
67 | 67 | * @throws JsonMapperException |
68 | 68 | */ |
69 | 69 | public function __construct( |
70 | | - public readonly array $types, |
| 70 | + public array $types, |
71 | 71 | ) { |
72 | 72 | $this->ensureNotEmpty(); |
73 | 73 | $this->ensureNoDuplicateTypes(); |
|
0 commit comments