assert
assert copied to clipboard
Is there a way to assert for known specific values?
Is there an efficient concise way to Assert for known possible values ahead of time, i.e. if a variable has values of either 0 or 1 (strings)? This is for a specific case with checkboxes.
But what about a more general case, like {alpha, beta, gamma, zetta}?
Assertion::choice may helps
Assertion::choice(mixed $value, array $choices); Assertion::choicesNotEmpty(array $values, array $choices);