From 12c75859d9db36755e89ef1c0f9238b91be4b634 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 12 Dec 2024 17:46:40 +0700 Subject: [PATCH] Create instanceof of PHPParser Standard --- src/Rules/ForbiddenNodeRule.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Rules/ForbiddenNodeRule.php b/src/Rules/ForbiddenNodeRule.php index 1a0bd5f2..7e946737 100644 --- a/src/Rules/ForbiddenNodeRule.php +++ b/src/Rules/ForbiddenNodeRule.php @@ -34,16 +34,18 @@ final class ForbiddenNodeRule implements Rule, DocumentedRuleInterface, Configur */ private array $forbiddenNodes = []; + private readonly Standard $standard; + /** * @param array> $forbiddenNodes */ public function __construct( - private readonly Standard $standard, array $forbiddenNodes ) { Assert::allIsAOf($forbiddenNodes, Node::class); $this->forbiddenNodes = $forbiddenNodes; + $this->standard = new Standard(); } public function getNodeType(): string