respect-validation/src-dev/Markdown/CompositeLinter.php
Henrique Moody 098c973a2a
Add GitHub action to lint documentation files
When we make changes to the category of a validator, it's easy to forget
to update overall list of validators. This commit a GitHub actions that
will run a console command to check if the documentation it up-to-date.

The job will fail when we need to change the document, but the console
command will fix the issues, so there isn't a lot of friction there.
2026-01-13 23:37:05 -07:00

30 lines
592 B
PHP

<?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Dev\Markdown;
final readonly class CompositeLinter implements Linter
{
/** @var array<Linter> */
private array $linters;
public function __construct(Linter $linter, Linter ...$linters)
{
$this->linters = [$linter, ...$linters];
}
public function lint(File $file): File
{
foreach ($this->linters as $linter) {
$file = $linter->lint($file);
}
return $file;
}
}