diff --git a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php index 4ad2b332d46..4e9f545245e 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php @@ -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 @@ -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; } }