/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/JsonSchema/JsonSchema.php
39 строк
1 KB
Daniel Polito
Add anyOf support to JSON schema (#60509)
15 июн 2026, 18:36
Не верифицирован
15 июн 2026, 18:36
92529f0
Код
Авторство
О чём код?
<?php namespace Illuminate\JsonSchema; use Closure; use Illuminate\JsonSchema\Types\Type; /** * @method static Types\ObjectType object(Closure|array<string, Types\Type> $properties = []) * @method static Types\AnyOfType anyOf(Closure|array<int, Types\Type> $schemas) * @method static Types\IntegerType integer() * @method static Types\NumberType number() * @method static Types\StringType string() * @method static Types\BooleanType boolean() * @method static Types\ArrayType array() * @method static Types\UnionType union(array<int, string> $types) */ class JsonSchema { /** * Build a type from a raw array of the Laravel-supported JSON Schema subset. * * @param array<string, mixed> $schema * * @throws \InvalidArgumentException */ public static function fromArray(array $schema): Type { return Deserializer::deserialize($schema); } /** * Dynamically pass static methods to the schema instance. */ public static function __callStatic(string $name, mixed $arguments): Type { return (new JsonSchemaTypeFactory)->$name(...$arguments); } }