-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
When a colleague and i wanted to include the "DeclareCoverageRule" into a reporting suit of ours we identified, that the "DeclareCoverageRule" does not provide an identifier. The other Rules do that.
This could be the solution
final readonly class DeclareCoverageRule implements Rule
{
public const string IDENTIFIER = 'typeCoverage.declareCoverage';
// ...
/**
* @param CollectedDataNode $node
* @return RuleError[]
*/
public function processNode(Node $node, Scope $scope): array
{
// ...
$ruleErrors = [];
foreach ($notCoveredDeclareFilePaths as $notCoveredDeclareFilePath) {
$errorMessage = sprintf(
self::ERROR_MESSAGE,
$totalPossibleDeclares,
$coveredDeclares,
$declareCoverage,
$requiredDeclareLevel,
);
$ruleErrors[] = RuleErrorBuilder::message($errorMessage)
->identifier(self::IDENTIFIER)
->file($notCoveredDeclareFilePath)
->build();
}
return $ruleErrors;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels