laminas / laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria
https://docs.laminas.dev/laminas-validator/
BSD 3-Clause "New" or "Revised" License
126 stars 55 forks source link

Add `EnumCase` and `BackedEnumValue` Validators #372

Closed gsteel closed 1 month ago

gsteel commented 1 month ago
Q A
Documentation yes
New Feature yes

Description

Adds 2 new validators to check that a given value is either a valid enum case, or a valid value for a backed enum.

Rather than expand the InArray validator, I prefer a more explicit approach which also keeps the InArray validator simple, and therefore: