NumberType
class NumberType extends Type
Properties
| protected bool|null | $required | Whether the type is required. |
from Type |
| protected string|null | $title | The type's title. |
from Type |
| protected string|null | $description | The type's description. |
from Type |
| protected mixed | $default | The default value for the type. |
from Type |
| protected bool | $hasDefault | Whether a default value was provided. |
from Type |
| protected null|array<int, mixed> | $enum | The set of allowed values for the type. |
from Type |
| protected bool|null | $nullable | Indicates if the type is nullable. |
from Type |
| protected int|float|null | $minimum | The minimum value (inclusive). |
|
| protected int|float|null | $maximum | The maximum value (inclusive). |
|
| protected int|float|null | $multipleOf | The number the value must be a multiple of. |
Methods
Build a type from a raw array of the Hypervel-supported JSON Schema subset.
Dynamically pass static methods to the schema instance.
No description
Set the minimum value (inclusive).
Set the maximum value (inclusive).
Set the number the value must be a multiple of.
Set the type's default value.
Details
in
JsonSchema at line 38
static Type
fromArray(array $schema)
Build a type from a raw array of the Hypervel-supported JSON Schema subset.
in
JsonSchema at line 46
static Type
__callStatic(string $name, array $arguments)
Dynamically pass static methods to the schema instance.
in
JsonSchema at line 29
static ObjectType
object(Closure|array<string $, Type> $properties = '[]')
No description
in
JsonSchema at line 29
static AnyOfType
anyOf(Closure|array<int $, Type> $schemas)
No description
in
JsonSchema at line 29
static IntegerType
integer()
No description
in
JsonSchema at line 29
static NumberType
number()
No description
in
JsonSchema at line 29
static StringType
string()
No description
in
JsonSchema at line 29
static BooleanType
boolean()
No description
in
JsonSchema at line 29
static ArrayType
array()
No description
in
JsonSchema at line 29
static UnionType
union(array<int $, string> $types)
No description
in
Type at line 111
Type
enum(array|string $values)
Restrict the value to one of the provided enumerated values.
in
Type at line 135
array
toArray()
Convert the type to an array.
in
Type at line 147
string
toString()
Convert the type to its string representation.
in
Type at line 159
string
__toString()
Convert the type to its string representation.
at line 27
NumberType
min(int|float $value)
Set the minimum value (inclusive).
at line 37
NumberType
max(int|float $value)
Set the maximum value (inclusive).
at line 47
NumberType
multipleOf(int|float $value)
Set the number the value must be a multiple of.
at line 57
NumberType
default(int|float|null $value)
Set the type's default value.