1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix highlight_string return type default

This commit is contained in:
Matthew Brown 2018-04-30 01:49:55 -04:00
parent 59bbf6f896
commit acacde173e

View File

@ -93,10 +93,13 @@ class FunctionChecker extends FunctionLikeChecker
return Type::getString();
}
return new Type\Union([new Type\Atomic\TString, new Type\Atomic\TNull]);
return new Type\Union([
new Type\Atomic\TString,
$call_map_key === 'var_export' ? new Type\Atomic\TNull : new Type\Atomic\TBool
]);
}
return Type::getVoid();
return $call_map_key === 'var_export' ? Type::getVoid() : Type::getBool();
}
if (substr($call_map_key, 0, 6) === 'array_') {