From cfa0829a388c51c76db5f652fa165bf14b0baa9a Mon Sep 17 00:00:00 2001 From: Brown Date: Mon, 4 Mar 2019 13:20:19 -0500 Subject: [PATCH] Make scanner more accepting of reflection errors --- src/Psalm/Internal/Codebase/Scanner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Codebase/Scanner.php b/src/Psalm/Internal/Codebase/Scanner.php index b8bf0d6e0..e5b6b029a 100644 --- a/src/Psalm/Internal/Codebase/Scanner.php +++ b/src/Psalm/Internal/Codebase/Scanner.php @@ -280,6 +280,10 @@ class Scanner $fq_classlike_name_lc = strtolower($fq_classlike_name); + if ($fq_classlike_name_lc === 'static') { + return; + } + // avoid checking classes that we know will just end in failure if ($fq_classlike_name_lc === 'null' || substr($fq_classlike_name_lc, -5) === '\null') { return; @@ -715,7 +719,7 @@ class Scanner /** @psalm-suppress TypeCoercion */ $reflected_class = new \ReflectionClass($fq_class_name); - } catch (\ReflectionException $e) { + } catch (\Throwable $e) { error_reporting($old_level); // do not cache any results here (as case-sensitive filenames can screw things up)