PHP Class Devise\Pages\Interpreter\Modifiers\EchoDeviseMagic

Inheritance: extends PhpParser\NodeVisitorAbstract
Afficher le fichier Open project: devisephp/cms

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

enterNode() public méthode

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

examineExpression() protected méthode

Determines what to do with this expression
protected examineExpression ( $node ) : [type]
Résultat [type]

examineFunction() protected méthode

Examines the function node for places to put dvsmagic() wrappers
protected examineFunction ( PhpParser\Node $node ) : PhpParser\Node
$node PhpParser\Node
Résultat PhpParser\Node

isWhiteListedFunction() protected méthode

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]
Résultat boolean

traverseIntoEchoStatement() protected méthode

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_
Résultat PhpParser\Node\Stmt\Echo_

wrapNodeWithMagicMethods() protected méthode

wraps the node inside of the dvsmagic method
protected wrapNodeWithMagicMethods ( PhpParser\Node $node ) : PhpParser\Node
$node PhpParser\Node
Résultat PhpParser\Node