-
Notifications
You must be signed in to change notification settings - Fork 819
PackedArray::fromJSON() and toJSON methods #3806
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
Conversation
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.
Some markup comments
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
|
||
<refentry xml:id="mongodb-bson-packedarray.fromjson" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
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.
Nit: Please don't put a blank line in new files :)
<?xml version="1.0" encoding="utf-8"?> | |
<!-- $Revision$ --> | |
<refentry xml:id="mongodb-bson-packedarray.fromjson" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- $Revision$ --> | |
<refentry xml:id="mongodb-bson-packedarray.fromjson" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
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.
Noted! I wasn't aware of that convention. Out of curiosity, is it mentioned anywhere on http://doc.php.net/tutorial/?
@Girgias: Also, I noticed you didn't suggest removing blank lines between <refsect1>
blocks. Are those still permitted for readability?
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.
Yeah between <refsect1>
is OK. I don't think it is mentioned in the tutorial as that hasn't been updated in a while :/
&reftitle.errors; | ||
<simplelist> | ||
&mongodb.throws.argumentparsing; | ||
<member>Throws <classname>MongoDB\Driver\Exception\UnexpectedValueException</classname> if <parameter>json</parameter> is not a valid array.</member> |
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.
Possible mistake?
<member>Throws <classname>MongoDB\Driver\Exception\UnexpectedValueException</classname> if <parameter>json</parameter> is not a valid array.</member> | |
<member>Throws <classname>MongoDB\Driver\Exception\UnexpectedValueException</classname> if <parameter>json</parameter> is invalid JSON.</member> |
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.
This was adapted from the Document::fromJSON()
method, which says "is not a valid document". I'll change both to say "if $json
cannot be parsed as a document" (or "an array").
It's not just a matter of the JSON being valid. PackedArray::fromJSON()
requires an actual array (i.e. outermost brackets) or an object with sequential numeric keys. There's some more context in mongodb/mongo-php-driver#1703.
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.
XML changes look good to me :)
https://jira.mongodb.org/browse/PHPC-2350