Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
```php title="PHP"
<?php declare(strict_types=1);
use Kreuzberg\Kreuzberg;
class ContentQualityValidator implements Validator {
private int $minLength = 10;
private int $maxLength = 1000000;
public function name(): string {
return "content-quality-validator";
}
public function version(): string {
return "1.0.0";
}
public function initialize(): void {
// Load validation rules or patterns
}
public function shutdown(): void {
// Cleanup resources
}
public function validate(object $result, object $config): void {
$contentLength = strlen($result->content);
if ($contentLength < $this->minLength) {
throw new Exception(
"Content too short: $contentLength < {$this->minLength} characters"
);
}
if ($contentLength > $this->maxLength) {
throw new Exception(
"Content too long: $contentLength > {$this->maxLength} characters"
);
}
}
public function priority(): int {
return 100;
}
}
// Register the validator
$validator = new ContentQualityValidator();
Kreuzberg::registerValidator($validator);
echo "Content quality validator registered\n";
```