Skip to content

Commit

Permalink
fixup! Update functionMap
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Nov 27, 2023
1 parent 046ea30 commit fff2584
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5700,7 +5700,7 @@
'jpeg2wbmp' => ['bool', 'jpegname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'],
'json_decode' => ['mixed', 'json'=>'string', 'assoc='=>'bool|null', 'depth='=>'positive-int', 'options='=>'int'],
'json_encode' => ['non-empty-string|false', 'data'=>'mixed', 'options='=>'int', 'depth='=>'positive-int'],
'json_last_error' => ['JSON_ERROR_*'],
'json_last_error' => ['JSON_ERROR_NONE|JSON_ERROR_DEPTH|JSON_ERROR_STATE_MISMATCH|JSON_ERROR_CTRL_CHAR|JSON_ERROR_SYNTAX|JSON_ERROR_UTF8|JSON_ERROR_RECURSION|JSON_ERROR_INF_OR_NAN|JSON_ERROR_UNSUPPORTED_TYPE|JSON_ERROR_INVALID_PROPERTY_NAME|JSON_ERROR_UTF16'],
'json_last_error_msg' => ['string'],
'JsonIncrementalParser::__construct' => ['void', 'depth'=>'', 'options'=>''],
'JsonIncrementalParser::get' => ['', 'options'=>''],
Expand Down
6 changes: 3 additions & 3 deletions tests/PHPStan/Analyser/data/bug-2863.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use function PHPStan\Testing\assertType;

$result = json_decode('{"a":5}');
assertType('int', json_last_error());
assertType('0|1|2|3|4|5|6|7|8|9|10', json_last_error());
assertType('string', json_last_error_msg());

if (json_last_error() !== JSON_ERROR_NONE || json_last_error_msg() !== 'No error') {
Expand All @@ -17,7 +17,7 @@

//
$result2 = json_decode('');
assertType('int', json_last_error());
assertType('0|1|2|3|4|5|6|7|8|9|10', json_last_error());
assertType('string', json_last_error_msg());

if (json_last_error() !== JSON_ERROR_NONE || json_last_error_msg() !== 'No error') {
Expand All @@ -29,7 +29,7 @@

//
$result3 = json_encode([]);
assertType('int', json_last_error());
assertType('0|1|2|3|4|5|6|7|8|9|10', json_last_error());
assertType('string', json_last_error_msg());

if (json_last_error() !== JSON_ERROR_NONE || json_last_error_msg() !== 'No error') {
Expand Down

0 comments on commit fff2584

Please sign in to comment.