Skip to content

TypeConstraint checks if a value is really a numeric array or it's an object #267

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

Closed
wants to merge 3 commits into from
Closed

Conversation

Alex-PK
Copy link

@Alex-PK Alex-PK commented May 19, 2016

As JSON objects are represented as PHP arrays once decoded, the type check didn't work when importing json or yaml files.
I improved the check for both arrays and objects.

@Alex-PK
Copy link
Author

Alex-PK commented Jun 1, 2016

I added a check for empty arrays for both array and object check.
Most tests pass, but 2 from schema-v3 don't, as they test empty arrays and objects which, in PHP, are equivalent.

The alternative would be to go back to check only for is_object() and is_array(), but this would force to use stdClass everywhere a json object is needed.

I am open to suggestions as to how to manage this.

@bighappyface
Copy link
Collaborator

@Alex-PK any movement on this regarding testing?

@Alex-PK Alex-PK closed this Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants