PHP 클래스 Kahlan\Jit\Parser

파일 보기 프로젝트 열기: crysalead/kahlan 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
_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.

메소드 상세

__construct() 공개 메소드

The constructor function
public __construct ( array $config = [] )
$config array The configuration array.

_assignCoverable() 보호된 메소드

Assign coverable data to lines.
protected _assignCoverable ( )

_assignLine() 보호된 메소드

Assign a node to a specific line.
protected _assignLine ( $index, object $node, $line )
$node object The node to match.

_assignLines() 보호된 메소드

Assign the node to some lines and makes them availaible at the root node.
protected _assignLines ( object $node )
$node object The node to match.

_classNode() 보호된 메소드

Build a class node.
protected _classNode ( )

_closeCurly() 보호된 메소드

Manage curly brackets.
protected _closeCurly ( )

_codeNode() 보호된 메소드

Build a code node.
protected _codeNode ( $type = null, $coverable = false )

_codeType() 보호된 메소드

Get code type from context
protected _codeType ( ) : string
리턴 string

_commentNode() 보호된 메소드

Build a comment node.
protected _commentNode ( )

_contextualize() 보호된 메소드

Contextualize a node.
protected _contextualize ( $node, $coverable = false )

_declareNode() 보호된 메소드

Build a namespace node.
protected _declareNode ( )

_flushUses() 보호된 메소드

Attache the founded uses to the current namespace.
protected _flushUses ( )

_functionNode() 보호된 메소드

Build a function node.
protected _functionNode ( )

_initLines() 보호된 메소드

Adds lines stores for root node.
protected _initLines ( string $content )
$content string A php file content.

_interfaceNode() 보호된 메소드

Build an interface node.
protected _interfaceNode ( )

_isCoverable() 보호된 메소드

Checks if a specific line is coverable.
protected _isCoverable ( integer $index ) : boolean
$index integer The line to check.
리턴 boolean

_namespaceNode() 보호된 메소드

Build a namespace node.
protected _namespaceNode ( )

_normalizeClass() 보호된 메소드

Normalizes a class name.
protected _normalizeClass ( string $name ) : string
$name string A class name value.
리턴 string The fully namespaced class extends value.

_normalizeImplements() 보호된 메소드

Formats an implements string.
protected _normalizeImplements ( string $implements ) : array
$implements string The implements string.
리턴 array The implements array.

_parseArgs() 보호된 메소드

Extracting a function/method args array from a stream.
protected _parseArgs ( ) : array
리턴 array The function/method args array.

_parser() 보호된 메소드

Parsing a file into nested nodes.
protected _parser ( string $content, boolean $lines = false ) : object
$content string A file.
$lines boolean Indicate if the parser need to process line mathing.
리턴 object The parsed file node.

_stringNode() 보호된 메소드

Build a string node.
protected _stringNode ( $delimiter = '' )

_traitNode() 보호된 메소드

Build a trait node.
protected _traitNode ( )

_useNode() 보호된 메소드

Manage use statement.
protected _useNode ( )

debug() 공개 정적인 메소드

Returns a reader-friendly output for debug purpose.
public static debug ( $content ) : string
리턴 string the unparsed file.

parse() 공개 정적인 메소드

Parsing a file into nested nodes.
public static parse ( $content, $config = [] ) : object
리턴 object the parsed file node.

unparse() 공개 정적인 메소드

Unparsing a node.
public static unparse ( $node ) : string
리턴 string the unparsed file.

프로퍼티 상세

$_root 보호되어 있는 프로퍼티

The root node.
protected object $_root
리턴 object

$_states 보호되어 있는 프로퍼티

[ '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 ]
protected array $_states
리턴 array

$_stream 보호되어 있는 프로퍼티

The current streamer.
protected object $_stream
리턴 object