24 lines
514 B
PHP
24 lines
514 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Ingest;
|
|
|
|
use App\Index\IndexMetaManager;
|
|
|
|
final readonly class GuardrailValidator
|
|
{
|
|
public function __construct(
|
|
private IndexMetaManager $metaManager,
|
|
) {}
|
|
|
|
/**
|
|
* Wirft eine Exception, wenn ein lokaler Ingest nicht kompatibel ist
|
|
* und ein Global Reindex erforderlich ist.
|
|
*/
|
|
public function validateOrThrow(): void
|
|
{
|
|
$this->metaManager->ensureExists();
|
|
$this->metaManager->validateAgainstCurrent();
|
|
}
|
|
} |