Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / UserSave.php
diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/UserSave.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/UserSave.php
new file mode 100644 (file)
index 0000000..0a76940
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
+
+use Drupal\drupalmoduleupgrader\TargetInterface;
+use Pharborist\Functions\FunctionCallNode;
+use Pharborist\Objects\ObjectMethodCallNode;
+
+/**
+ * @Converter(
+ *  id = "user_save",
+ *  description = @Translation("Rewrites calls to user_save()."),
+ *  fixme = @Translation("user_save() is now a method of the user entity.")
+ * )
+ */
+class UserSave extends FunctionCallModifier {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function rewrite(FunctionCallNode $call, TargetInterface $target) {
+    $arguments = $call->getArguments();
+
+    if (sizeof($arguments) == 1) {
+      return ObjectMethodCallNode::create(clone $arguments[0], 'save');
+    }
+  }
+
+}