LaravelDataToSchema
extends TypeToSchemaExtension
in package
Table of Contents
Methods
- reference() : Reference
- Set a reference to that object in the return.
- shouldHandle() : bool
- We establish that we handle here all the Spatie\LaravelData\Data classes.
- toSchema() : Type|null
- convertReflected() : Type
- Given a pure reflected PHP type, we return the corresponding Scramble type equivalent before Generator conversion.
- handleBuiltin() : Type
- handleUnionType() : Type
Methods
reference()
Set a reference to that object in the return.
public
reference(ObjectType $type) : Reference
Parameters
- $type : ObjectType
Return values
ReferenceshouldHandle()
We establish that we handle here all the Spatie\LaravelData\Data classes.
public
shouldHandle(Type $type) : bool
This is because it is a pro feature of scramble and we do not have that kind of money.
Parameters
- $type : Type
Return values
booltoSchema()
public
toSchema(Type $type) : Type|null
Parameters
- $type : Type
-
the type being transformed to schema
Return values
Type|nullconvertReflected()
Given a pure reflected PHP type, we return the corresponding Scramble type equivalent before Generator conversion.
private
convertReflected(ReflectionNamedType|ReflectionUnionType|ReflectionType|null $type) : Type
Parameters
- $type : ReflectionNamedType|ReflectionUnionType|ReflectionType|null
Tags
Return values
TypehandleBuiltin()
private
handleBuiltin(string $type) : Type
Parameters
- $type : string
Return values
TypehandleUnionType()
private
handleUnionType(ReflectionUnionType $union) : Type
Parameters
- $union : ReflectionUnionType