Skip to content

Accepted kinds

phil/url-bundle

A field and a constraint name the kinds they accept in any of these forms, alone or in a list:

FormAccepts
nullEvery international kind, KnownUrlType::class
An enum class, RegistryUrlType::classAll its cases
A case, KnownUrlType::InstagramThat kind
An EnumSetIts cases

Cases of one enum make one set; sets keep the order they first appear in, which is the order detection tries them (phil/url). An application's own kinds come before the international ones when listed first:

['types' => [RegistryUrlType::class, KnownUrlType::class]]

Anything else throws an InvalidArgumentException when the field or the constraint is used.