From db7abc2b9062fce4cae4bcd6d9a7d559472c826e Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Thu, 4 Jan 2018 14:13:54 -0500 Subject: [PATCH] Add more debug output when using reflection/composer classmap --- src/Psalm/Checker/ProjectChecker.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Psalm/Checker/ProjectChecker.php b/src/Psalm/Checker/ProjectChecker.php index 4d081aded..59df2187c 100644 --- a/src/Psalm/Checker/ProjectChecker.php +++ b/src/Psalm/Checker/ProjectChecker.php @@ -492,6 +492,10 @@ class ProjectChecker if (isset($this->existing_classlikes_lc[$fq_classlike_name_lc]) && $this->existing_classlikes_lc[$fq_classlike_name_lc] ) { + if ($this->debug_output) { + echo 'Using reflection to get metadata for ' . $fq_classlike_name . PHP_EOL; + } + $reflected_class = new \ReflectionClass($fq_classlike_name); ClassLikeChecker::registerReflectedClass($reflected_class->name, $reflected_class, $this); $this->reflected_classeslikes_lc[$fq_classlike_name_lc] = true; @@ -1507,6 +1511,10 @@ class ProjectChecker if (isset($this->composer_classmap[$fq_class_name_lc])) { if (file_exists($this->composer_classmap[$fq_class_name_lc])) { + if ($this->debug_output) { + echo 'Using generated composer classmap to locate file for ' . $fq_class_name . PHP_EOL; + } + $this->existing_classlikes_lc[$fq_class_name_lc] = true; $this->existing_classlikes[$fq_class_name] = true; $this->classlike_files[$fq_class_name_lc] = $this->composer_classmap[$fq_class_name_lc]; @@ -1522,6 +1530,10 @@ class ProjectChecker } try { + if ($this->debug_output) { + echo 'Using reflection to locate file for ' . $fq_class_name . PHP_EOL; + } + $reflected_class = new \ReflectionClass($fq_class_name); } catch (\ReflectionException $e) { error_reporting($old_level);