Parser
in package
Table of Contents
- TRIGGER_BEGIN = 1
- TRIGGER_COMPLETE = 14
- TRIGGER_DEPTH_LIMIT = 8
- TRIGGER_NONE = 0
- Plugin triggers.
- TRIGGER_RECURSION = 4
- TRIGGER_SUCCESS = 2
- $caller_class : mixed
- $depth_limit : mixed
- $marker : mixed
- $object_hashes : mixed
- $parse_break : mixed
- $plugins : mixed
- __construct() : mixed
- addPlugin() : mixed
- childHasPath() : mixed
- clearPlugins() : mixed
- getCallerClass() : mixed
- getCleanArray() : array<string|int, mixed>
- Returns an array without the recursion marker in it.
- getDepthLimit() : mixed
- haltParse() : mixed
- parse() : BasicObject
- Parses a variable into a Kint object structure.
- parseDeep() : BasicObject
- Disables the depth limit and parses a variable.
- setCallerClass() : mixed
- Set the caller class.
- setDepthLimit() : mixed
- Set the depth limit.
- noRecurseCall() : mixed
- applyPlugins() : bool
- Applies plugins for an object type.
- parseArray() : BasicObject
- Parses an array into a Kint object structure.
- parseGeneric() : mixed
- parseObject() : BasicObject
- Parses an object into a Kint InstanceObject structure.
- parseResource() : BasicObject
- Parses a resource into a Kint ResourceObject structure.
- parseString() : BasicObject
- Parses a string into a Kint BlobObject structure.
- parseUnknown() : BasicObject
- Parses an unknown into a Kint object structure.
Constants
TRIGGER_BEGIN
public
mixed
TRIGGER_BEGIN
= 1
TRIGGER_COMPLETE
public
mixed
TRIGGER_COMPLETE
= 14
TRIGGER_DEPTH_LIMIT
public
mixed
TRIGGER_DEPTH_LIMIT
= 8
TRIGGER_NONE
Plugin triggers.
public
mixed
TRIGGER_NONE
= 0
These are constants indicating trigger points for plugins
BEGIN: Before normal parsing SUCCESS: After successful parsing RECURSION: After parsing cancelled by recursion DEPTH_LIMIT: After parsing cancelled by depth limit COMPLETE: SUCCESS | RECURSION | DEPTH_LIMIT
While a plugin's getTriggers may return any of these
TRIGGER_RECURSION
public
mixed
TRIGGER_RECURSION
= 4
TRIGGER_SUCCESS
public
mixed
TRIGGER_SUCCESS
= 2
Properties
$caller_class
protected
mixed
$caller_class
$depth_limit
protected
mixed
$depth_limit
= false
$marker
protected
mixed
$marker
$object_hashes
protected
mixed
$object_hashes
= array()
$parse_break
protected
mixed
$parse_break
= false
$plugins
protected
mixed
$plugins
= array()
Methods
__construct()
public
__construct([false|int $depth_limit = false ][, null|string $caller = null ]) : mixed
Parameters
- $depth_limit : false|int = false
-
Maximum depth to parse data
- $caller : null|string = null
-
Caller class name
Return values
mixed —addPlugin()
public
addPlugin(Plugin $p) : mixed
Parameters
- $p : Plugin
Return values
mixed —childHasPath()
public
childHasPath(InstanceObject $parent, BasicObject $child) : mixed
Parameters
- $parent : InstanceObject
- $child : BasicObject
Return values
mixed —clearPlugins()
public
clearPlugins() : mixed
Return values
mixed —getCallerClass()
public
getCallerClass() : mixed
Return values
mixed —getCleanArray()
Returns an array without the recursion marker in it.
public
getCleanArray(array<string|int, mixed> $array) : array<string|int, mixed>
DO NOT pass an array that has had it's marker removed back into the parser, it will result in an extra recursion
Parameters
- $array : array<string|int, mixed>
-
Array potentially containing a recursion marker
Return values
array<string|int, mixed> —Array with recursion marker removed
getDepthLimit()
public
getDepthLimit() : mixed
Return values
mixed —haltParse()
public
haltParse() : mixed
Return values
mixed —parse()
Parses a variable into a Kint object structure.
public
parse(mixed &$var, BasicObject $o) : BasicObject
Parameters
- $var : mixed
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —parseDeep()
Disables the depth limit and parses a variable.
public
parseDeep(mixed &$var, BasicObject $o) : BasicObject
This should not be used unless you know what you're doing!
Parameters
- $var : mixed
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —setCallerClass()
Set the caller class.
public
setCallerClass([null|string $caller = null ]) : mixed
Parameters
- $caller : null|string = null
-
Caller class name
Return values
mixed —setDepthLimit()
Set the depth limit.
public
setDepthLimit([false|int $depth_limit = false ]) : mixed
Parameters
- $depth_limit : false|int = false
-
Maximum depth to parse data
Return values
mixed —noRecurseCall()
protected
noRecurseCall() : mixed
Return values
mixed —applyPlugins()
Applies plugins for an object type.
private
applyPlugins(mixed &$var, BasicObject &$o, int $trigger) : bool
Parameters
- $var : mixed
-
variable
- $o : BasicObject
-
Kint object parsed so far
- $trigger : int
-
The trigger to check for the plugins
Return values
bool —Continue parsing
parseArray()
Parses an array into a Kint object structure.
private
parseArray(array<string|int, mixed> &$var, BasicObject $o) : BasicObject
Parameters
- $var : array<string|int, mixed>
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —parseGeneric()
private
parseGeneric(mixed &$var, BasicObject $o) : mixed
Parameters
- $var : mixed
- $o : BasicObject
Return values
mixed —parseObject()
Parses an object into a Kint InstanceObject structure.
private
parseObject(object &$var, BasicObject $o) : BasicObject
Parameters
- $var : object
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —parseResource()
Parses a resource into a Kint ResourceObject structure.
private
parseResource(resource &$var, BasicObject $o) : BasicObject
Parameters
- $var : resource
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —parseString()
Parses a string into a Kint BlobObject structure.
private
parseString(string &$var, BasicObject $o) : BasicObject
Parameters
- $var : string
-
The input variable
- $o : BasicObject
-
The base object
Return values
BasicObject —parseUnknown()
Parses an unknown into a Kint object structure.
private
parseUnknown(mixed &$var, BasicObject $o) : BasicObject
Parameters
- $var : mixed
-
The input variable
- $o : BasicObject
-
The base object