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

Prevent checking reflected methods for mutations

This commit is contained in:
Matthew Brown 2017-07-09 15:19:05 -04:00
parent 922b6640fa
commit 39a27f41b3

View File

@ -911,6 +911,12 @@ class ProjectChecker
$appearing_method_id = (string)MethodChecker::getAppearingMethodId($original_method_id);
list($appearing_fq_class_name) = explode('::', $appearing_method_id);
$appearing_class_storage = ClassLikeChecker::$storage[$appearing_fq_class_name];
if (!$appearing_class_storage->user_defined) {
return;
}
if (strtolower($appearing_fq_class_name) !== strtolower($fq_class_name)) {
$file_checker = $this->getVisitedFileCheckerForClassLike($appearing_fq_class_name);
}