Property | Type | Description | |
---|---|---|---|
$_root | object | The root node. | |
$_states | array | [ 'php' => false, // Indicate if the parser is in a PHP block. 'class' => false, // Indicate if the parser is in a PHP class. 'lines' => false, // Indicate if the parser need to process line mathing. 'num' => 0, // Current line number. 'root' => object, // Root node. 'current' => object, // Current node. 'visibility' => [] // Store function visibility. 'uses' => [] // Maintain the uses dependencies 'body' => '' // Maintain the current parsed content ] | |
$_stream | object | The current streamer. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) | The constructor function | |
debug ( $content ) : string | Returns a reader-friendly output for debug purpose. | |
parse ( $content, $config = [] ) : object | Parsing a file into nested nodes. | |
unparse ( $node ) : string | Unparsing a node. |
Method | Description | |
---|---|---|
_assignCoverable ( ) | Assign coverable data to lines. | |
_assignLine ( $index, object $node, $line ) | Assign a node to a specific line. | |
_assignLines ( object $node ) | Assign the node to some lines and makes them availaible at the root node. | |
_classNode ( ) | Build a class node. | |
_closeCurly ( ) | Manage curly brackets. | |
_codeNode ( $type = null, $coverable = false ) | Build a code node. | |
_codeType ( ) : string | Get code type from context | |
_commentNode ( ) | Build a comment node. | |
_contextualize ( $node, $coverable = false ) | Contextualize a node. | |
_declareNode ( ) | Build a namespace node. | |
_flushUses ( ) | Attache the founded uses to the current namespace. | |
_functionNode ( ) | Build a function node. | |
_initLines ( string $content ) | Adds lines stores for root node. | |
_interfaceNode ( ) | Build an interface node. | |
_isCoverable ( integer $index ) : boolean | Checks if a specific line is coverable. | |
_namespaceNode ( ) | Build a namespace node. | |
_normalizeClass ( string $name ) : string | Normalizes a class name. | |
_normalizeImplements ( string $implements ) : array | Formats an implements string. | |
_parseArgs ( ) : array | Extracting a function/method args array from a stream. | |
_parser ( string $content, boolean $lines = false ) : object | Parsing a file into nested nodes. | |
_stringNode ( $delimiter = '' ) | Build a string node. | |
_traitNode ( ) | Build a trait node. | |
_useNode ( ) | Manage use statement. |
public __construct ( array $config = [] ) | ||
$config | array | The configuration array. |
protected _assignLine ( $index, object $node, $line ) | ||
$node | object | The node to match. |
protected _assignLines ( object $node ) | ||
$node | object | The node to match. |
protected _codeNode ( $type = null, $coverable = false ) |
protected _contextualize ( $node, $coverable = false ) |
protected _flushUses ( ) |
protected _initLines ( string $content ) | ||
$content | string | A php file content. |
protected _isCoverable ( integer $index ) : boolean | ||
$index | integer | The line to check. |
return | boolean |
protected _normalizeClass ( string $name ) : string | ||
$name | string | A class name value. |
return | string | The fully namespaced class extends value. |
protected _normalizeImplements ( string $implements ) : array | ||
$implements | string | The implements string. |
return | array | The implements array. |
protected _parseArgs ( ) : array | ||
return | array | The function/method args array. |
protected array $_states | ||
return | array |