Remove useless method

This commit is contained in:
huangzhhui 2020-05-20 17:23:39 +08:00
parent 571aca1fe9
commit 3ac073748d

View File

@ -50,7 +50,7 @@ class Ast
$traverser = new NodeTraverser();
$visitorMetadata = new VisitorMetadata();
$visitorMetadata->className = $className;
// User could modify or replace the node vistors by Hyperf\Autoload\AstVisitorCollector.
// User could modify or replace the node vistors by Hyperf\Di\Aop\AstVisitorRegistry.
$queue = clone AstVisitorRegistry::getQueue();
foreach ($queue as $string) {
$visitor = new $string($visitorMetadata);
@ -60,23 +60,6 @@ class Ast
return $this->printer->prettyPrintFile($modifiedStmts);
}
public function parseClassByStmts(array $stmts): string
{
$namespace = $className = '';
foreach ($stmts as $stmt) {
if ($stmt instanceof Namespace_ && $stmt->name) {
$namespace = $stmt->name->toString();
foreach ($stmt->stmts as $node) {
if ($node instanceof Class_ && $node->name) {
$className = $node->name->toString();
break;
}
}
}
}
return ($namespace && $className) ? $namespace . '\\' . $className : '';
}
private function getCodeByClassName(string $className): string
{
$file = Composer::getLoader()->findFile($className);