Skip to content

Feature Request: Check that multiple specific keys exist in an array #258

Description

@gordinskiy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions