From ac5823095d4514bbf06e1910b2c0ba23dbdbef15 Mon Sep 17 00:00:00 2001 From: jarstelfox Date: Wed, 1 Jul 2020 06:01:25 -0700 Subject: [PATCH] TemplateChecker: Ensure it's working again (#3724) * TemplateChecker: Ensure it's working again The template checker is erroring on my first template file due to storage missing on my pseudo method. I traced back to your original + noticed the optional param had been removed. * TemplateChecker: Add missing use --- examples/TemplateChecker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/TemplateChecker.php b/examples/TemplateChecker.php index db70100ad..3772babba 100644 --- a/examples/TemplateChecker.php +++ b/examples/TemplateChecker.php @@ -11,6 +11,7 @@ use Psalm\Internal\Analyzer\StatementsAnalyzer; use Psalm\CodeLocation; use Psalm\Context; use Psalm\DocComment; +use Psalm\Storage\MethodStorage; use Psalm\Type; class TemplateAnalyzer extends Psalm\Internal\Analyzer\FileAnalyzer @@ -156,7 +157,7 @@ class TemplateAnalyzer extends Psalm\Internal\Analyzer\FileAnalyzer $class_analyzer = new ClassAnalyzer($class, $this, self::VIEW_CLASS); - $view_method_analyzer = new MethodAnalyzer($class_method, $class_analyzer); + $view_method_analyzer = new MethodAnalyzer($class_method, $class_analyzer, new MethodStorage()); if (!$context->check_variables) { $view_method_analyzer->addSuppressedIssue('UndefinedVariable');