mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 11:48:08 +08:00
Remove useless method
This commit is contained in:
parent
571aca1fe9
commit
3ac073748d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user