Naneau\Obfuscator\Node\Visitor\ScramblePrivateMethod::scanMethodDefinitions PHP Method

scanMethodDefinitions() private method

Recursively scan for private method definitions and rename them
private scanMethodDefinitions ( array $nodes ) : void
$nodes array
return void
    private function scanMethodDefinitions(array $nodes)
    {
        foreach ($nodes as $node) {
            // Scramble the private method definitions
            if ($node instanceof ClassMethod && $node->type & ClassNode::MODIFIER_PRIVATE) {
                // Record original name and scramble it
                $originalName = $node->name;
                $this->scramble($node);
                // Record renaming
                $this->renamed($originalName, $node->name);
            }
            // Recurse over child nodes
            if (isset($node->stmts) && is_array($node->stmts)) {
                $this->scanMethodDefinitions($node->stmts);
            }
        }
    }