Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion::keySet #297

Open
fracz opened this issue Feb 9, 2020 · 0 comments
Open

Assertion::keySet #297

fracz opened this issue Feb 9, 2020 · 0 comments

Comments

@fracz
Copy link

fracz commented Feb 9, 2020

What do you think about an assertion that validates if the array meets the specified set of keys?

Assertion::keySet(['a' => 1], ['a']); // ok
Assertion::keySet(['a' => 1], ['a', 'b']); // not ok
Assertion::keySet(['a' => 1, 'b' => 1], ['a']); // not ok

Inspired by https://respect-validation.readthedocs.io/en/1.1/rules/KeySet/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant