Add Type::ENUM constraint #2

Closed
opened 2023-11-20 12:16:42 +01:00 by vlw · 0 comments
vlw commented 2023-11-20 12:16:42 +01:00 (Migrated from codeberg.org)

A new type ENUM would match the provided value in scope for the property name against an array of allowed values.

For example:

Rule->type(Type::ENUM, [
  "FOO",
  "BAR",
  "BIZ
]);

Any value that doesn't exist in the provided enum will cause the type() constraint to return an error

A new type `ENUM` would match the provided value in scope for the property name against an array of allowed values. For example: ```php Rule->type(Type::ENUM, [ "FOO", "BAR", "BIZ ]); ``` Any value that doesn't exist in the provided enum will cause the `type()` constraint to return an error
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
reflect/rules-plugin#2
No description provided.