Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / FormSetValue.php
diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/FormSetValue.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/FormSetValue.php
new file mode 100644 (file)
index 0000000..1d3aa84
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
+
+use Drupal\drupalmoduleupgrader\TargetInterface;
+use Pharborist\Functions\FunctionCallNode;
+use Pharborist\Objects\ObjectMethodCallNode;
+
+/**
+ * @Converter(
+ *  id = "form_set_value",
+ *  description = @Translation("Rewrites calls to form_set_value().")
+ * )
+ */
+class FormSetValue extends FunctionCallModifier {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function rewrite(FunctionCallNode $call, TargetInterface $target) {
+    $arguments = $call->getArguments();
+
+    return ObjectMethodCallNode::create($arguments[2]->remove(), 'setValueForElement')
+      ->appendArgument(clone $arguments[0])
+      ->appendArgument(clone $arguments[1]);
+  }
+
+}