thephpleague / json-guard

Validation of json-schema.org compliant schemas.
http://json-guard.thephpleague.com/
MIT License
175 stars 26 forks source link

Fixes enum constraint edge case with objects equality #101

Closed marcioAlmada closed 7 years ago

marcioAlmada commented 7 years ago

Attempts to close #100

matt-allan commented 7 years ago

👍 I think this is the correct fix.

marcioAlmada commented 7 years ago

Hmm.. travis said it's broken :thinking:

matt-allan commented 7 years ago

I think removing the strict makes PHP attempt to compare the object to an int by casting the object.

It's trying to do this:

in_array((object) ['foo' => 'false'], [6, "foo", [], true, (object) ['foo' => 12]]);
marcioAlmada commented 7 years ago

Oh dear, php ^^ different strategy for object then.

marcioAlmada commented 7 years ago

It's green :D

matt-allan commented 7 years ago

Nice 👍

master is full of breaking changes right now so I'm going to cherry pick this and the other bug fixes into 0.5.2 when I get a chance.

marcioAlmada commented 7 years ago

Great. Thank you!

matt-allan commented 7 years ago

I just tagged 0.5.2. Thanks!

https://packagist.org/packages/league/json-guard#0.5.2