sandbox = $sandbox; } public function leaveNode(Node $node){ if ($node instanceof Node\Expr\FuncCall) { if($node->name instanceof Node\Name) { $name = strtolower($node->name->toString()); try { $this->sandbox->checkFunc($name); } catch (\Exception $e) { return new Node\Expr\StaticCall( new Node\Name\FullyQualified("CloudObjects\\PhpMAE\\Sandbox\\FunctionExecutor"), 'execute', array_merge([ new Node\Scalar\String_($name) ], $node->args), $node->getAttributes()); } } } return null; } }