3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
5 use Drupal\drupalmoduleupgrader\TargetInterface;
6 use Pharborist\Functions\FunctionCallNode;
7 use Pharborist\Objects\ClassMethodCallNode;
12 * description = @Translation("Rewrites calls to cache_get().")
15 class CacheGet extends FunctionCallModifier {
20 public function rewrite(FunctionCallNode $call, TargetInterface $target) {
21 $arguments = $call->getArguments();
23 $get = ClassMethodCallNode::create('\Drupal', 'cache');
24 if (sizeof($arguments) == 2) {
25 $get->appendArgument(clone $arguments[1]);
28 return $get->appendMethodCall('get')->appendArgument(clone $arguments[0]);