mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Merge pull request #9479 from fluffycondor/json_throw_with_unescaped_unicode
This commit is contained in:
commit
d6daaa842e
@ -1467,7 +1467,11 @@ function json_decode(string $json, ?bool $associative = null, int $depth = 512,
|
||||
/**
|
||||
* @psalm-pure
|
||||
*
|
||||
* @return ($flags is 4194304 ? non-empty-string : non-empty-string|false)
|
||||
* @return (
|
||||
* $flags is 4194304
|
||||
* ? non-empty-string
|
||||
* : ($flags is 4194560 ? non-empty-string : non-empty-string|false)
|
||||
* )
|
||||
*
|
||||
* @psalm-flow ($value) -> return
|
||||
* @psalm-ignore-falsable-return
|
||||
|
@ -123,5 +123,13 @@ class CoreStubsTest extends TestCase
|
||||
'$a===' => 'string',
|
||||
],
|
||||
];
|
||||
yield 'json_encode returns a non-empty-string provided JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE' => [
|
||||
'code' => '<?php
|
||||
$a = json_encode([], JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);
|
||||
',
|
||||
'assertions' => [
|
||||
'$a===' => 'non-empty-string',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user