Skip to content

Commit

Permalink
Update PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Sep 29, 2023
1 parent b2a8e26 commit e8be55a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
24 changes: 9 additions & 15 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,27 +551,21 @@ public function getParsedBody(
* associative arrays; when false, JSON objects will be returned as objects.
* When null, JSON objects will be returned as associative arrays or objects
* depending on whether JSON_OBJECT_AS_ARRAY is set in the flags.
* @param int $flags <p>
* Bitmask of JSON decode options:<br/>
* {@see \JSON_BIGINT_AS_STRING} decodes large integers as their original
* string value.<br/>
* {@see \JSON_INVALID_UTF8_IGNORE} ignores invalid UTF-8 characters,<br/>
* {@see \JSON_INVALID_UTF8_SUBSTITUTE} converts invalid UTF-8 characters to
* \0xfffd,<br/>
* {@see \JSON_OBJECT_AS_ARRAY} decodes JSON objects as PHP array, since
* 7.2.0 used by default if $assoc parameter is null,<br/>
* {@see \JSON_THROW_ON_ERROR} when passed this flag, the error behaviour of
* these functions is changed. The global error state is left untouched, and
* if an error occurs that would otherwise set it, these functions instead
* throw a JsonException<br/>
* </p>
* @param int|null $flags [optional] <p>
* Bitmask consisting of <b>JSON_BIGINT_AS_STRING</b>,
* <b>JSON_INVALID_UTF8_IGNORE</b>,
* <b>JSON_INVALID_UTF8_SUBSTITUTE</b>,
* <b>JSON_OBJECT_AS_ARRAY</b>,
* <b>JSON_THROW_ON_ERROR</b>.
* </p>
* <p>Default is none when null.</p>
* @param int<1,max> $depth user specified recursion depth
*
* @see https://www.php.net/manual/en/function.json-decode.php
* @see https://www.php.net/manual/en/json.constants.php
*
* @return array<string,mixed>|false|stdClass If option JSON_THROW_ON_ERROR
* is not set, return false if json_decode fail. Otherwise return a
* is not set, return false if json_decode fail. Otherwise, return a
* stdClass instance, or an array if the $associative argument is passed as
* true.
*/
Expand Down
36 changes: 20 additions & 16 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,22 +601,26 @@ protected function negotiateEtag() : void
*
* @param mixed $data The data being encoded. Can be any type except
* a resource.
* @param int|null $flags <p>
* Bitmask consisting of
* {@see \JSON_HEX_QUOT}<br/>
* {@see \JSON_HEX_TAG}<br/>
* {@see \JSON_HEX_AMP}<br/>
* {@see \JSON_HEX_APOS}<br/>
* {@see \JSON_NUMERIC_CHECK}<br/>
* {@see \JSON_PRETTY_PRINT}<br/>
* {@see \JSON_UNESCAPED_SLASHES}<br/>
* {@see \JSON_FORCE_OBJECT}<br/>
* {@see \JSON_UNESCAPED_UNICODE}<br/>
* {@see \JSON_THROW_ON_ERROR}<br/>
* The behaviour of these constants is described on the JSON constants page.
* </p>
* <p>Default is <b>JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE</b>
* when null. Set 0 to do not use none.</p>
* @param int|null $flags [optional] <p>
* Bitmask consisting of <b>JSON_FORCE_OBJECT</b>,
* <b>JSON_HEX_AMP</b>,
* <b>JSON_HEX_APOS</b>,
* <b>JSON_HEX_QUOT</b>,
* <b>JSON_HEX_TAG</b>,
* <b>JSON_INVALID_UTF8_IGNORE</b>,
* <b>JSON_INVALID_UTF8_SUBSTITUTE</b>,
* <b>JSON_INVALID_UTF8_SUBSTITUTE</b>,
* <b>JSON_NUMERIC_CHECK</b>,
* <b>JSON_PARTIAL_OUTPUT_ON_ERROR</b>,
* <b>JSON_PRESERVE_ZERO_FRACTION</b>,
* <b>JSON_PRETTY_PRINT</b>,
* <b>JSON_THROW_ON_ERROR</b>.
* <b>JSON_UNESCAPED_LINE_TERMINATORS</b>,
* <b>JSON_UNESCAPED_SLASHES</b>,
* <b>JSON_UNESCAPED_UNICODE</b>,
* </p>
* <p>Default is <b>JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE</b>
* when null. <b>JSON_THROW_ON_ERROR</b> is enforced by default.</p>
* @param int<1,max> $depth Set the maximum depth. Must be greater than zero.
*
* @see https://www.php.net/manual/en/function.json-encode.php
Expand Down

0 comments on commit e8be55a

Please sign in to comment.