From acacde173ebbc3fac21cf34cd76f371b0cfc7dfe Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 30 Apr 2018 01:49:55 -0400 Subject: [PATCH] Fix highlight_string return type default --- src/Psalm/Checker/FunctionChecker.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Checker/FunctionChecker.php b/src/Psalm/Checker/FunctionChecker.php index 5e8603e95..cf79be41e 100644 --- a/src/Psalm/Checker/FunctionChecker.php +++ b/src/Psalm/Checker/FunctionChecker.php @@ -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_') {