$sandbox
$sandbox : \PHPSandbox\PHPSandbox
The PHPSandbox instance to check against
Validator class for PHP Sandboxes.
This class takes parsed AST code and checks it against the passed PHPSandbox instance configuration for errors, and throws exceptions if they are found
$sandbox : \PHPSandbox\PHPSandbox
The PHPSandbox instance to check against
__construct(\PHPSandbox\PHPSandbox $sandbox)
ValidatorVisitor class constructor
This constructor takes a passed PHPSandbox instance to check against for validating sandboxed code.
\PHPSandbox\PHPSandbox | $sandbox | The PHPSandbox instance to check against |
leaveNode(\PhpParser\Node $node) : \PhpParser\Node|boolean|null
Examine the current PhpParser_Node node against the PHPSandbox configuration for validating sandboxed code
\PhpParser\Node | $node | The sandboxed $node to validate |
Throws an exception if validation fails
Return rewritten node, false if node must be removed, or null if no changes to the node are made
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
\PhpParser\Node | $node | The sandboxed $node to test |
Return string name of node, or null if it is not a magic constant
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
\PhpParser\Node | $node | The sandboxed $node to test |
Return string name of node, or null if it is not a keyword
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
\PhpParser\Node | $node | The sandboxed $node to test |
Return string name of node, or null if it is not an operator
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
\PhpParser\Node | $node | The sandboxed $node to test |
Return string name of node, or null if it is not a primitive