mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
Fix empty literal string becomes non-empty-string
when max literal string length is 0, which means literal strings are disabled
This commit is contained in:
parent
079bfb837c
commit
a2bf5cb054
@ -287,7 +287,7 @@ abstract class Type
|
||||
$type = $config->eventDispatcher->dispatchStringInterpreter($event);
|
||||
|
||||
if (!$type) {
|
||||
if (strlen($value) < $config->max_string_length) {
|
||||
if ($value === '' || strlen($value) < $config->max_string_length) {
|
||||
$type = new TLiteralString($value, $from_docblock);
|
||||
} else {
|
||||
$type = new TNonEmptyString($from_docblock);
|
||||
|
Loading…
x
Reference in New Issue
Block a user