3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
5 use Drupal\drupalmoduleupgrader\TargetInterface;
6 use Pharborist\Functions\FunctionCallNode;
7 use Pharborist\Objects\ClassMethodCallNode;
8 use Pharborist\Types\FalseNode;
9 use Pharborist\Types\StringNode;
13 * id = "theme_get_registry",
14 * description = @Translation("Rewrites calls to theme_get_registry().")
17 class ThemeGetRegistry extends FunctionCallModifier {
22 public function rewrite(FunctionCallNode $call, TargetInterface $target) {
23 $arguments = $call->getArguments()->toArray();
25 return ClassMethodCallNode::create('\Drupal', 'service')
26 ->appendArgument(StringNode::fromValue('theme.registry'))
27 ->appendMethodCall(($arguments && $arguments[0] instanceof FalseNode) ? 'getRuntime' : 'get');