1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-29 20:28:59 +01:00

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
This commit is contained in:
jarstelfox 2020-07-01 06:01:25 -07:00 committed by GitHub
parent 4c368da75e
commit ac5823095d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');