Class DataTypeLexer
Parse a data type definition into it's various components. For example:
>>> $type = new DataTypeLexer("Integer(11, primary_key = true)");
>>> $type->getType(); "Integer" >>> $type->getArgs();
array(11, "primary_key" => true)
Methods summary
public
|
#
__construct( string $def )
Object Constructor
Parameters
- $def
string $def Data Type Definition
|
public
array
|
#
getArgs( )
Get the positional arguments in the definition
Get the positional arguments in the definition
Returns
array
|
public
string
|
#
getType( )
Get the Data Type form the definition
Get the Data Type form the definition
Returns
string
|
protected
array
|
#
lexString( string $def )
Lexically analyze the given string into a stream of tokens.
Lexically analyze the given string into a stream of tokens.
Parameters
Returns
array
|
protected
mixed
|
#
normalizeToken( string $token )
Normalize the given token into PHP values
Normalize the given token into PHP values
Parameters
Returns
mixed
|
protected
|
#
parse( string $def )
Lex and parse the given token, saving it's data into the object
Lex and parse the given token, saving it's data into the object
Parameters
|