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

Do not throw error when reflectionmethod fails

This commit is contained in:
Matthew Brown 2016-04-30 15:02:16 -04:00
parent cb59baec87
commit 286158e07d

View File

@ -1950,10 +1950,15 @@ class StatementsChecker
$method_id = preg_replace('/^[^:]+::/', '', $method_id);
}
$reflection_parameters = (new \ReflectionFunction($method_id))->getParameters();
try {
$reflection_parameters = (new \ReflectionFunction($method_id))->getParameters();
// if value is passed by reference
return $argument_offset < count($reflection_parameters) && $reflection_parameters[$argument_offset]->isPassedByReference();
// if value is passed by reference
return $argument_offset < count($reflection_parameters) && $reflection_parameters[$argument_offset]->isPassedByReference();
}
catch (\ReflectionException $e) {
return false;
}
}