完善打包,解析方法不混淆

This commit is contained in:
2022-11-25 17:08:25 +08:00
parent b5c49962e1
commit e6bbdc0297

View File

@@ -4,7 +4,9 @@ namespace app\common\tools\phpparser;
use PhpParser\Node;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Global_;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitorAbstract;
@@ -27,6 +29,17 @@ class NodeFakeVarVisitorTools extends NodeVisitorAbstract
'this'
];
public function enterNode(Node $node)
{
if ($node instanceof ClassMethod) {
if ($node->name instanceof Identifier) {
if ($node->name->name == '__construct') {
return NodeTraverser::DONT_TRAVERSE_CHILDREN;
}
}
}
}
public function leaveNode(Node $node)
{