Skip to content

Commit

Permalink
add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 16, 2021
1 parent 919bb98 commit 298c97a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/Transform/Rector/StaticCall/StaticCallToNewRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Rector\Transform\ValueObject\StaticCallToNew;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use Webmozart\Assert\Assert;

/**
* @changelog https://github.com/symfony/symfony/pull/35308
Expand Down Expand Up @@ -101,6 +102,7 @@ public function refactor(Node $node): ?Node
public function configure(array $configuration): void
{
$staticCallsToNews = $configuration[self::STATIC_CALLS_TO_NEWS] ?? [];
Assert::allIsAOf($staticCallsToNews, StaticCallToNew::class);
$this->staticCallsToNews = $staticCallsToNews;
}
}

0 comments on commit 298c97a

Please sign in to comment.