Skip to content

Commit a03341f

Browse files
committed
StubValidator - create registries just once
1 parent b9839ac commit a03341f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/PhpDoc/StubValidator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@ public function validate(array $stubFiles, bool $debug): array
5858

5959
$analysedFiles = array_fill_keys($stubFiles, true);
6060

61+
$ruleRegistry = new DirectRuleRegistry($container->getServicesByTag(self::SERVICE_RULE_TAG));
62+
$collectorRegistry = new CollectorRegistry([]);
63+
6164
$errors = [];
6265
foreach ($stubFiles as $stubFile) {
6366
try {
6467
$tmpErrors = $fileAnalyser->analyseFile(
6568
$stubFile,
6669
$analysedFiles,
67-
new DirectRuleRegistry($container->getServicesByTag(self::SERVICE_RULE_TAG)),
68-
new CollectorRegistry([]),
70+
$ruleRegistry,
71+
$collectorRegistry,
6972
static function (): void {
7073
},
7174
)->getErrors();

0 commit comments

Comments
 (0)