Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / FormSetValue.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
4
5 use Drupal\drupalmoduleupgrader\TargetInterface;
6 use Pharborist\Functions\FunctionCallNode;
7 use Pharborist\Objects\ObjectMethodCallNode;
8
9 /**
10  * @Converter(
11  *  id = "form_set_value",
12  *  description = @Translation("Rewrites calls to form_set_value().")
13  * )
14  */
15 class FormSetValue extends FunctionCallModifier {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function rewrite(FunctionCallNode $call, TargetInterface $target) {
21     $arguments = $call->getArguments();
22
23     return ObjectMethodCallNode::create($arguments[2]->remove(), 'setValueForElement')
24       ->appendArgument(clone $arguments[0])
25       ->appendArgument(clone $arguments[1]);
26   }
27
28 }