PHP Класс Devise\Pages\Interpreter\Modifiers\EchoDeviseMagic

Наследование: extends PhpParser\NodeVisitorAbstract
Показать файл Открыть проект

Открытые методы

Метод Описание
__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