24 lines
438 B
PHP
24 lines
438 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Services\ContentSanitizer;
|
|
|
|
final class ArtworkDescriptionContentValidator
|
|
{
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public static function errors(null|string $value): array
|
|
{
|
|
$normalized = trim((string) ($value ?? ''));
|
|
|
|
if ($normalized === '') {
|
|
return [];
|
|
}
|
|
|
|
return ContentSanitizer::validate($normalized);
|
|
}
|
|
} |