3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
5 use Drupal\drupalmoduleupgrader\TargetInterface;
6 use Pharborist\Functions\FunctionCallNode;
7 use Pharborist\Objects\ClassMethodCallNode;
11 * id = "ctools_object_cache_set",
12 * description = @Translation("Rewrites calls to ctools_object_cache_set().")
15 class CToolsObjectCacheSet extends FunctionCallModifier {
20 public function rewrite(FunctionCallNode $call, TargetInterface $target) {
21 $arguments = $call->getArguments()->toArray();
22 array_shift($arguments);
24 if (sizeof($arguments) == 3) {
25 array_pop($arguments);
28 return ClassMethodCallNode::create('\Drupal', 'service')
29 ->appendArgument('user.tempstore')
30 ->appendMethodCall('set')
31 ->appendArgument($arguments[0])
32 ->appendArgument($arguments[1]);