Skip to content

Commit

Permalink
Fix highlight_string return type default
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Apr 30, 2018
1 parent 29765ac commit f9cb79d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Psalm/Checker/FunctionChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ public static function getReturnTypeFromCallMapWithArgs(
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_') {
Expand Down

0 comments on commit f9cb79d

Please sign in to comment.