Update ProxyClassNameVistor.php

This commit is contained in:
张城铭 2019-07-29 15:14:29 +08:00 committed by GitHub
parent 99ec84d7b5
commit b81cf6735c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ class ProxyClassNameVistor extends NodeVisitorAbstract
public function leaveNode(Node $node)
{
// Rewirte the class name and extends the original class.
if ($node instanceof Node\Stmt\Class_) {
if ($node instanceof Node\Stmt\Class_ && !$node->isAnonymous()) {
$node->extends = $node->name;
$node->name = new Node\Identifier($this->proxyClassName);
return $node;