Menu

## WhitelistVisitor extends NodeVisitorAbstract
in package

WhitelistVisitor.php : 22

Whitelister class for PHP Sandboxes.

This class takes parsed AST code and checks it against the passed PHPSandbox instance configuration to autmatically whitelist trusted code functions, classes, etc. if the appropriate settings are configured.

##### Tags

namespace

  PHPSandbox

author

  Elijah Horton elijah@corveda.com

version
  3.0

### Table of Contents

$sandbox : PHPSandbox
  The PHPSandbox instance to check against
__construct() : mixed
  WhitelistVisitor class constructor
leaveNode() : bool|null
  Examine the current PhpParser_Node node against the PHPSandbox configuration for whitelisting trusted code

### Properties

#### $sandbox

WhitelistVisitor.php : 26

The PHPSandbox instance to check against

`protected PHPSandbox $sandbox`

### Methods

#### __construct()

WhitelistVisitor.php : 34

WhitelistVisitor class constructor

`public __construct(PHPSandbox $sandbox) : mixed`

This constructor takes a passed PHPSandbox instance to check against for whitelisting trusted code.

##### Parameters

$sandbox : PHPSandbox

  The PHPSandbox instance to check against

##### Return values

mixed —

#### leaveNode()

WhitelistVisitor.php : 46

Examine the current PhpParser_Node node against the PHPSandbox configuration for whitelisting trusted code

`public leaveNode(Node $node) : bool|null`

##### Parameters

$node : Node

  The trusted $node to examine

##### Tags

throws
  Throwable

##### Return values

bool|null —

Return false if node must be removed, or null if no changes to the node are made

## Search results