Файл: vendor/laravel/framework/src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php
Строк: 94
<?php
namespace IlluminateJsonSchema;
use Closure;
use IlluminateContractsJsonSchemaJsonSchema as JsonSchemaContract;
class JsonSchemaTypeFactory extends JsonSchema implements JsonSchemaContract
{
/**
* Create a new object schema instance.
*
* @param (Closure(JsonSchemaTypeFactory): array<string, TypesType>)|array<string, TypesType> $properties
*/
public function object(Closure|array $properties = []): TypesObjectType
{
if ($properties instanceof Closure) {
$properties = $properties($this);
}
return new TypesObjectType($properties);
}
/**
* Create a new array property instance.
*/
public function array(): TypesArrayType
{
return new TypesArrayType;
}
/**
* Create a new string property instance.
*/
public function string(): TypesStringType
{
return new TypesStringType;
}
/**
* Create a new integer property instance.
*/
public function integer(): TypesIntegerType
{
return new TypesIntegerType;
}
/**
* Create a new number property instance.
*/
public function number(): TypesNumberType
{
return new TypesNumberType;
}
/**
* Create a new boolean property instance.
*/
public function boolean(): TypesBooleanType
{
return new TypesBooleanType;
}
/**
* Create a new multi-type union instance.
*
* @param array<int, string> $types
*/
public function union(array $types): TypesUnionType
{
return new TypesUnionType($types);
}
}