PHP 클래스 PhpSandbox\ValidatorVisitor

This class takes parsed AST code and checks it against the passed PHPSandbox instance configuration for errors, and throws exceptions if they are found
저자: Elijah Horton ([email protected])
상속: extends PhpParser\NodeVisitorAbstract
파일 보기 프로젝트 열기: Corveda/PHPSandbox

보호된 프로퍼티들

프로퍼티 타입 설명
$sandbox PHPSandbox The PHPSandbox instance to check against

공개 메소드들

메소드 설명
__construct ( PHPSandbox $sandbox ) ValidatorVisitor class constructor
leaveNode ( PhpParser\Node $node ) : PhpParser\Node | boolean | null Examine the current PhpParser_Node node against the PHPSandbox configuration for validating sandboxed code

보호된 메소드들

메소드 설명
isKeyword ( PhpParser\Node $node ) : string | null Test the current PhpParser_Node node to see if it is a keyword, and return the name if it is and null if it is not
isMagicConst ( PhpParser\Node $node ) : string | null Test the current PhpParser_Node node to see if it is a magic constant, and return the name if it is and null if it is not
isOperator ( PhpParser\Node $node ) : string | null Test the current PhpParser_Node node to see if it is an operator, and return the name if it is and null if it is not
isPrimitive ( PhpParser\Node $node ) : string | null Test the current PhpParser_Node node to see if it is a primitive, and return the name if it is and null if it is not

메소드 상세

__construct() 공개 메소드

This constructor takes a passed PHPSandbox instance to check against for validating sandboxed code.
public __construct ( PHPSandbox $sandbox )
$sandbox PHPSandbox The PHPSandbox instance to check against

isKeyword() 보호된 메소드

Test the current PhpParser_Node node to see if it is a keyword, and return the name if it is and null if it is not
protected isKeyword ( PhpParser\Node $node ) : string | null
$node PhpParser\Node The sandboxed $node to test
리턴 string | null Return string name of node, or null if it is not a keyword

isMagicConst() 보호된 메소드

Test the current PhpParser_Node node to see if it is a magic constant, and return the name if it is and null if it is not
protected isMagicConst ( PhpParser\Node $node ) : string | null
$node PhpParser\Node The sandboxed $node to test
리턴 string | null Return string name of node, or null if it is not a magic constant

isOperator() 보호된 메소드

Test the current PhpParser_Node node to see if it is an operator, and return the name if it is and null if it is not
protected isOperator ( PhpParser\Node $node ) : string | null
$node PhpParser\Node The sandboxed $node to test
리턴 string | null Return string name of node, or null if it is not an operator

isPrimitive() 보호된 메소드

Test the current PhpParser_Node node to see if it is a primitive, and return the name if it is and null if it is not
protected isPrimitive ( PhpParser\Node $node ) : string | null
$node PhpParser\Node The sandboxed $node to test
리턴 string | null Return string name of node, or null if it is not a primitive

leaveNode() 공개 메소드

Examine the current PhpParser_Node node against the PHPSandbox configuration for validating sandboxed code
public leaveNode ( PhpParser\Node $node ) : PhpParser\Node | boolean | null
$node PhpParser\Node The sandboxed $node to validate
리턴 PhpParser\Node | boolean | null Return rewritten node, false if node must be removed, or null if no changes to the node are made

프로퍼티 상세

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

The PHPSandbox instance to check against
protected PHPSandbox,phpsandbox $sandbox
리턴 PHPSandbox