| @@ 123-142 (lines=20) @@ | ||
| 120 | * @param Node[] $nodes |
|
| 121 | * @return void |
|
| 122 | **/ |
|
| 123 | private function scanMethodDefinitions(array $nodes) |
|
| 124 | { |
|
| 125 | foreach ($nodes as $node) { |
|
| 126 | // Scramble the private method definitions |
|
| 127 | if ($node instanceof ClassMethod && ($node->type & ClassNode::MODIFIER_PRIVATE)) { |
|
| 128 | ||
| 129 | // Record original name and scramble it |
|
| 130 | $originalName = $node->name; |
|
| 131 | $this->scramble($node); |
|
| 132 | ||
| 133 | // Record renaming |
|
| 134 | $this->renamed($originalName, $node->name); |
|
| 135 | } |
|
| 136 | ||
| 137 | // Recurse over child nodes |
|
| 138 | if (isset($node->stmts) && is_array($node->stmts)) { |
|
| 139 | $this->scanMethodDefinitions($node->stmts); |
|
| 140 | } |
|
| 141 | } |
|
| 142 | } |
|
| 143 | } |
|
| 144 | ||
| @@ 98-120 (lines=23) @@ | ||
| 95 | * @param Node[] $nodes |
|
| 96 | * @return void |
|
| 97 | **/ |
|
| 98 | private function scanPropertyDefinitions(array $nodes) |
|
| 99 | { |
|
| 100 | foreach ($nodes as $node) { |
|
| 101 | // Scramble the private method definitions |
|
| 102 | if ($node instanceof Property && ($node->type & ClassNode::MODIFIER_PRIVATE)) { |
|
| 103 | foreach($node->props as $property) { |
|
| 104 | ||
| 105 | // Record original name and scramble it |
|
| 106 | $originalName = $property->name; |
|
| 107 | $this->scramble($property); |
|
| 108 | ||
| 109 | // Record renaming |
|
| 110 | $this->renamed($originalName, $property->name); |
|
| 111 | } |
|
| 112 | ||
| 113 | } |
|
| 114 | ||
| 115 | // Recurse over child nodes |
|
| 116 | if (isset($node->stmts) && is_array($node->stmts)) { |
|
| 117 | $this->scanPropertyDefinitions($node->stmts); |
|
| 118 | } |
|
| 119 | } |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||