2 declare(strict_types = 1);
19 use PhpParser\Node\Expr;
20 use PhpParser\Node\Expr\ClassConstFetch;
21 use PhpParser\Node\Expr\New_;
22 use PhpParser\Node\Expr\StaticCall;
23 use PhpParser\Node\Name\FullyQualified;
24 use PhpParser\Node\Scalar\String_;
25 use PhpParser\NodeVisitorAbstract;
48 if ($node instanceof StaticCall
49 && $node->class instanceof FullyQualified
50 && $node->class->toString() === GeneralUtility::class
51 && $node->name->name ===
'makeInstance'
52 && isset($node->args[0]->value)
53 && $node->args[0]->value instanceof Expr
58 $node->args[0]->value = $className;
62 array_slice($node->args, 1),
63 $node->getAttributes()
70 if ($value instanceof String_) {
72 return new FullyQualified($value->value, $value->getAttributes());
74 if ($value instanceof ClassConstFetch && $value->class instanceof FullyQualified) {