Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Contracts;
4
5use SocialDept\AtpSchema\Data\LexiconDocument;
6
7interface LexiconValidator
8{
9 /**
10 * Validate data against Lexicon schema.
11 */
12 public function validate(array $data, LexiconDocument $schema): bool;
13
14 /**
15 * Validate and return errors.
16 *
17 * @return array<string, array<string>>
18 */
19 public function validateWithErrors(array $data, LexiconDocument $schema): array;
20
21 /**
22 * Validate a specific field.
23 */
24 public function validateField(mixed $value, string $field, LexiconDocument $schema): bool;
25
26 /**
27 * Set validation mode (strict, optimistic, lenient).
28 */
29 public function setMode(string $mode): void;
30}