PHP 클래스 Devise\Pages\Interpreter\Modifiers\EchoDeviseMagic

상속: extends PhpParser\NodeVisitorAbstract
파일 보기 프로젝트 열기: devisephp/cms

공개 메소드들

메소드 설명
__construct ( DeviseParser $DeviseParser ) Create a new EchoDeviseMagic visitor
enterNode ( PhpParser\Node $node ) : PhpParser\Node We need to look for different types of nodes inside of echo nodes only

보호된 메소드들

메소드 설명
examineExpression ( $node ) : [type] Determines what to do with this expression
examineFunction ( PhpParser\Node $node ) : PhpParser\Node Examines the function node for places to put dvsmagic() wrappers
isWhiteListedFunction ( [type] $node ) : boolean we don't want to be passing ###dvsmagic-field-1-attr### to php functions, except for those functions that have been whitelisted. The only one so far is 'e' which is created by Laravel's blade to escape variables
traverseIntoEchoStatement ( PhpParser\Node\Stmt\Echo_ $node ) : PhpParser\Node\Stmt\Echo_ Looks inside of this echo for valid combinations.
wrapNodeWithMagicMethods ( PhpParser\Node $node ) : PhpParser\Node wraps the node inside of the dvsmagic method

메소드 상세

__construct() 공개 메소드

Create a new EchoDeviseMagic visitor
public __construct ( DeviseParser $DeviseParser )
$DeviseParser Devise\Pages\Interpreter\DeviseParser

enterNode() 공개 메소드

We need to look for different types of nodes inside of echo nodes only
public enterNode ( PhpParser\Node $node ) : PhpParser\Node
$node PhpParser\Node
리턴 PhpParser\Node

examineExpression() 보호된 메소드

Determines what to do with this expression
protected examineExpression ( $node ) : [type]
리턴 [type]

examineFunction() 보호된 메소드

Examines the function node for places to put dvsmagic() wrappers
protected examineFunction ( PhpParser\Node $node ) : PhpParser\Node
$node PhpParser\Node
리턴 PhpParser\Node

isWhiteListedFunction() 보호된 메소드

For example: {{ $myvar }} becomes However for functions like route('some-route', $model->id) we don't want to be passing the magic field ever... we won't ever live update that and we shouldn't even try
protected isWhiteListedFunction ( [type] $node ) : boolean
$node [type]
리턴 boolean

traverseIntoEchoStatement() 보호된 메소드

This is a context free grammar tree at this point...
protected traverseIntoEchoStatement ( PhpParser\Node\Stmt\Echo_ $node ) : PhpParser\Node\Stmt\Echo_
$node PhpParser\Node\Stmt\Echo_
리턴 PhpParser\Node\Stmt\Echo_

wrapNodeWithMagicMethods() 보호된 메소드

wraps the node inside of the dvsmagic method
protected wrapNodeWithMagicMethods ( PhpParser\Node $node ) : PhpParser\Node
$node PhpParser\Node
리턴 PhpParser\Node