Skip to content

How to remove multiple options at once #8

Answered by rubenvanassche
AleJavierHY asked this question in Q&A
Discussion options

You must be logged in to vote

Since reject takes a closure you can just do this:

Options::forEnum(Hobbit::class)->reject(fn(Hobbit $hobbit) => in_array($hobbit, [Hobbit::Frodo, Hobbit::Sam]);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AleJavierHY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants