| 1 |
<?php declare(strict_types=1); |
| 2 |
|
| 3 |
/** |
| 4 |
* @license Apache 2.0 |
| 5 |
*/ |
| 6 |
|
| 7 |
namespace OpenApi; |
| 8 |
|
| 9 |
use OpenApi\Annotations as OA; |
| 10 |
|
| 11 |
interface TypeResolverInterface |
| 12 |
{ |
| 13 |
public const NATIVE_TYPE_MAP = [ |
| 14 |
'mixed' => 'mixed', |
| 15 |
'string' => 'string', |
| 16 |
'array' => 'array', |
| 17 |
'byte' => ['string', 'byte'], |
| 18 |
'boolean' => 'boolean', |
| 19 |
'bool' => 'boolean', |
| 20 |
'int' => 'integer', |
| 21 |
'integer' => 'integer', |
| 22 |
'long' => ['integer', 'long'], |
| 23 |
'float' => ['number', 'float'], |
| 24 |
'double' => ['number', 'double'], |
| 25 |
'date' => ['string', 'date'], |
| 26 |
'datetime' => ['string', 'date-time'], |
| 27 |
'\\datetime' => ['string', 'date-time'], |
| 28 |
'datetimeimmutable' => ['string', 'date-time'], |
| 29 |
'\\datetimeimmutable' => ['string', 'date-time'], |
| 30 |
'datetimeinterface' => ['string', 'date-time'], |
| 31 |
'\\datetimeinterface' => ['string', 'date-time'], |
| 32 |
'number' => 'number', |
| 33 |
'object' => 'object', |
| 34 |
]; |
| 35 |
|
| 36 |
public function mapNativeType(OA\Schema $schema, $type): bool; |
| 37 |
|
| 38 |
public function native2spec(string $type): string; |
| 39 |
|
| 40 |
/** |
| 41 |
* @param class-string<OA\AbstractAnnotation> $sourceClass optional source class type hint for resolving references to |
| 42 |
* other types as `OA\Schema` |
| 43 |
*/ |
| 44 |
public function augmentSchemaType(Analysis $analysis, OA\Schema $schema, string $sourceClass = OA\Schema::class): void; |
| 45 |
} |