MagicType
+ Inheritance diagram for MagicType:

Description

A ReflectionNamedType that supports annotated unions and other helpful things.

Protected Static Properties

static[] $union = []
 

Protected Properties

string $def
 

Public Static Methods

static self from (?ReflectionNamedType $type)
 

Public Methods

 __construct (string $def)
 
string __toString ()
 
bool allowsArray ()
 Whether the type allows arrays. More...
 
bool allowsGenerator ()
 Whether the type allows generators. More...
 
bool allowsMixed ()
 Whether the type allows mixed. More...
 
bool allowsNull ()
 Whether the type allows ?type, mixed, or null More...
 
bool allowsType (string $regex)
 
int count ()
 The number of subtypes in the union. More...
 
MagicType[] getSubtypes ()
 Returns the union component types. More...
 
bool isBuiltin ()
 
bool isUnion ()
 
void write (RefXML $xml)
 Reflector writes itself to the XML. More...
 

Methods

◆ allowsArray()

bool allowsArray ( )

Whether the type allows arrays.

Returns
bool

◆ allowsGenerator()

bool allowsGenerator ( )

Whether the type allows generators.

Returns
bool

◆ allowsMixed()

bool allowsMixed ( )

Whether the type allows mixed.

Returns
bool

◆ allowsNull()

bool allowsNull ( )

Whether the type allows ?type, mixed, or null

Returns
bool

◆ allowsType()

bool allowsType ( string  $regex)
Parameters
string$regex
Returns
bool

◆ count()

int count ( )

The number of subtypes in the union.

Returns
int

◆ from()

static self from ( ?ReflectionNamedType  $type)
static
Parameters
null | ReflectionNamedType$typeDefaults to mixed
Returns
self

◆ getSubtypes()

MagicType [] getSubtypes ( )

Returns the union component types.

Returns
MagicType[]

◆ isBuiltin()

bool isBuiltin ( )
Returns
bool

◆ isUnion()

bool isUnion ( )
Returns
bool

◆ write()

void write ( RefXML  $xml)

Reflector writes itself to the XML.

Parameters
RefXML$xml

Implements XMLWriterInterface.