You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whats about adding assertions for multiple array key existence.
Assert::keysExists(array $value, array $keys)
Check if all of provided key are presented in array
May be useful for validation of POST/PUT request where requester must provide entire object.
Assert::oneOfKeysExists(array $value, array $keys)
Check if at least one of provided key are presented in array
May be useful for validation of PATCH request where all fields can be optional but at least one must be provided.
The text was updated successfully, but these errors were encountered:
I had a use case today where I had to check a dozen array keys in an array. I'm surprised that this problem hasn't bothered anyone yet. So I'm also in favor of this suggestion.
Whats about adding assertions for multiple array key existence.
Assert::keysExists(array $value, array $keys)
Check if all of provided key are presented in array
May be useful for validation of POST/PUT request where requester must provide entire object.
Assert::oneOfKeysExists(array $value, array $keys)
Check if at least one of provided key are presented in array
May be useful for validation of PATCH request where all fields can be optional but at least one must be provided.
The text was updated successfully, but these errors were encountered: