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