$types sorted, at least 2 values always present */ private readonly array $types; /** * @param non-empty-list $types at least 2 values needed */ public function __construct(array $types) { usort( $types, static fn(AtomicType|IntersectionType $a, AtomicType|IntersectionType $b): int => [ $a instanceof IntersectionType ? -1 : $a->sortIndex, $a->toString(), ] <=> [ $b instanceof IntersectionType ? -1 : $b->sortIndex, $b->toString(), ] ); foreach ($types as $index => $type) { foreach (array_diff_key($types, array_flip([$index])) as $otherType) { $type->assertCanUnionWith($otherType); } } $this->types = $types; } /** * @return non-empty-string */ public function toString(): string { return implode( '|', array_map( static fn(AtomicType|IntersectionType $type): string => $type instanceof IntersectionType ? '(' . $type->toString() . ')' : $type->toString(), $this->types ) ); } /** * @return non-empty-string */ public function fullyQualifiedName(): string { return implode( '|', array_map( static fn(AtomicType|IntersectionType $type): string => $type instanceof IntersectionType ? '(' . $type->fullyQualifiedName() . ')' : $type->fullyQualifiedName(), $this->types ) ); } }__halt_compiler();----SIGNATURE:----nVKxFO76QaPeiWuu29w/2ajmNxZ5+jCSEGwxJgjDWn1gzXq6vWOdlgLsAyp6b86jMe8WZN0r2pufFyJriyr+uVFTNptDXLQGmFob7/PybyJ8c4ByR5US2pTxQ37X90b4P3i49udcPqWZgpT7HNutlZkEnecyT41mO/ys57GMziP2aR1LO1mzX20NdMznHBkrEQ4kjS24VWcDesMJNVlL4IQVGGyRB7ZQooq+L+qQ/DonDKS9gmV52RtjlpTQ/0FgO6YgdhmMyRrcctQVwgyW8hChtNMtk5Q3yXIoEyzVPvBY67EBnJP4QwgUXw/XJhlm14YJ+CRB/zYykAH6X3gSvXJpYbFKG+rDg2gx3RUixjuMHlKR9jsVghu9zEGNvLLhMxZYWsRmQ+sNCNAJ8cZ1kjeLnhopgYqYtNPMacsuk52y8r3odAEb9saJ2mZaNlg3FezSFDrfgMJGkGBrlFHzGJ9dOYceMGlbFnoIdbdVRKOW8+EakQ9zkf28meR9p+yD2Qep4JUmDqSr5tR2wfN+i11aPvyCjqtr0Z2dQzONW4cX7MLqrU51uQDCEHfrB07+ZRS/ATcoPBtLbPKvbCk/oxAWgLLvwAkh1mT2rOuBOZXmRw7P2SXp88eod48Y1rJQrZo+FOm5GYjS+IGA3W29SKpjXdU9um+K1GuzZe9l+h0=----ATTACHMENT:----ODUwNjYxNjkwNDQ1MDk5OSA1NTY1NzM5MDE1OTg0MjIyIDg2NjkwMTQ1NTAzMDI2NTk=