1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add version check for reflected function return type

This commit is contained in:
Matt Brown 2017-07-10 10:38:02 -04:00
parent d163b28cbf
commit cfbf256593

View File

@ -140,7 +140,9 @@ class FunctionChecker extends FunctionLikeChecker
$config = \Psalm\Config::getInstance();
if ($reflection_return_type = $reflection_function->getReturnType()) {
if (version_compare(PHP_VERSION, '7.0.0dev', '>=')
&& $reflection_return_type = $reflection_function->getReturnType()
) {
$storage->return_type = Type::parseString((string)$reflection_return_type);
}