Parse and validate AT Protocol Lexicons with DTO generation for Laravel
1<?php
2
3namespace SocialDept\AtpSchema\Contracts;
4
5interface TypeMapper
6{
7 /**
8 * Map Lexicon type to PHP type.
9 */
10 public function toPhpType(string $lexiconType): string;
11
12 /**
13 * Map Lexicon type to PHPDoc type.
14 */
15 public function toPhpDocType(string $lexiconType): string;
16
17 /**
18 * Handle union types.
19 *
20 * @param array<string> $types
21 */
22 public function unionType(array $types): string;
23
24 /**
25 * Check if type is nullable.
26 */
27 public function isNullable(array $definition): bool;
28
29 /**
30 * Resolve type reference.
31 */
32 public function resolveReference(string $ref): string;
33}