ArrayType implements Type
Read onlyYes
FinalYes
Tags
Interfaces
Properties
- $empty : bool
Methods
- __construct() : mixed
- empty() : self
- fromArray() : Type<string|int, T>
- isComparableWith() : bool
- isCompatible() : bool
- Checks if another type is compatible with this type. Nullability is validated from a schema evolution perspective.
- isEqual() : bool
- Checks if another type is equal to this type. Nullability is not considered in this comparison.
- isSame() : bool
- Checks if another type is the same as this type, including nullability.
- isValid() : bool
- makeNullable() : Type<string|int, T>
- merge() : Type<string|int, mixed>
- normalize() : array<string|int, mixed>
- nullable() : bool
- toString() : string
Properties
$empty
public
bool
$empty
= false
Methods
__construct()
public
__construct([bool $empty = false ][, bool $nullable = false ]) : mixed
Parameters
- $empty : bool = false
- $nullable : bool = false
empty()
public
static empty() : self
Return values
selffromArray()
public
static fromArray(array<string|int, mixed> $data) : Type<string|int, T>
Parameters
- $data : array<string|int, mixed>
Return values
Type<string|int, T>isComparableWith()
public
isComparableWith(Type $type) : bool
Parameters
- $type : Type
Return values
boolisCompatible()
Checks if another type is compatible with this type. Nullability is validated from a schema evolution perspective.
public
isCompatible(Type $type) : bool
This means that when current type is nullable and ther other type is not nullable, it is still compatible. When given type is not nullable and current type is nullable, it is not compatible.
Parameters
- $type : Type
Return values
boolisEqual()
Checks if another type is equal to this type. Nullability is not considered in this comparison.
public
isEqual(Type $type) : bool
Parameters
- $type : Type
Tags
Return values
boolisSame()
Checks if another type is the same as this type, including nullability.
public
isSame(Type $type) : bool
Parameters
- $type : Type
Return values
boolisValid()
public
isValid(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolmakeNullable()
public
makeNullable(bool $nullable) : Type<string|int, T>
Parameters
- $nullable : bool
Return values
Type<string|int, T>merge()
public
merge(Type $type) : Type<string|int, mixed>
Parameters
- $type : Type
Return values
Type<string|int, mixed>normalize()
public
normalize() : array<string|int, mixed>
Return values
array<string|int, mixed>nullable()
public
nullable() : bool
Return values
booltoString()
public
toString() : string