Skip to content

Commit

Permalink
Create instanceof of PHPParser Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 12, 2024
1 parent 19d882e commit 12c7585
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Rules/ForbiddenNodeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ final class ForbiddenNodeRule implements Rule, DocumentedRuleInterface, Configur
*/
private array $forbiddenNodes = [];

private readonly Standard $standard;

/**
* @param array<class-string<Node>> $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
Expand Down

0 comments on commit 12c7585

Please sign in to comment.