-
Notifications
You must be signed in to change notification settings - Fork 736
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
JSON Compat Library #614
JSON Compat Library #614
Conversation
$args = func_get_args(); | ||
|
||
// default to decoding into an assoc array | ||
if (sizeof($args) < 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use brackets please (like line 37).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
I like this 👍 |
- Removes need for global constant definitions - Allows easier handling of JSON parse errors
Yeah, Travis sometimes does that. Not sure why :-( I will restart the build. I also like this, especially because everything still seems to work :-) |
Almost all builds went green. I merged it. Thx. Will be part of the next release. |
Adds a
Elastica\JSON
class which provides wrappers forjson_encode
andjson_decode
.parse
(json_decode
)stringify
(json_encode
)"JSON_ELASTICSEARCH"
to be passed as$options
to use flag settings identified for ES compatability (alternate solution to Introduce ELASTICA_JSON_UNESCAPED_UNICODE ELASTICA_JSON_UNESCAPED_SLASHES #613)Other
If you're happy with this approach, I'll add some additional tests; just didn't want to spend time writing them if you opt not to go this route. Cheers!