From 655d9687919c28892f48afc90c031c53059f6cd9 Mon Sep 17 00:00:00 2001 From: Max Loeb Date: Sun, 1 Oct 2023 16:42:42 -0700 Subject: [PATCH] fix template --- phpstan-baseline.neon | 5 +++++ tests/PHPStan/Printer/PrinterTestBase.php | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4596cc77..04100fcd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10,6 +10,11 @@ parameters: count: 1 path: src/Ast/NodeTraverser.php + - + message: "#^Strict comparison using \\=\\=\\= between 2 and 2 will always evaluate to true\\.$#" + count: 2 + path: src/Ast/NodeTraverser.php + - message: "#^Variable property access on PHPStan\\\\PhpDocParser\\\\Ast\\\\Node\\.$#" count: 1 diff --git a/tests/PHPStan/Printer/PrinterTestBase.php b/tests/PHPStan/Printer/PrinterTestBase.php index 81ff813d..fc793ade 100644 --- a/tests/PHPStan/Printer/PrinterTestBase.php +++ b/tests/PHPStan/Printer/PrinterTestBase.php @@ -8,6 +8,7 @@ use PHPStan\PhpDocParser\Ast\Node; use PHPStan\PhpDocParser\Ast\NodeTraverser; use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode; +use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Parser\ConstExprParser; use PHPStan\PhpDocParser\Parser\PhpDocParser; use PHPStan\PhpDocParser\Parser\TypeParser; @@ -33,11 +34,11 @@ abstract class PrinterTestBase extends TestCase protected $phpDocParser; /** - * @template TNode $node of TypeNode + * @template TNode of TypeNode * @param TNode $node * @return TNode */ - public static function withComment(mixed $node, string $comment): mixed + public static function withComment(TypeNode $node, string $comment): TypeNode { $node->setAttribute(Attribute::COMMENTS, [new Comment($comment)]); return $node;