0a76940bed4e71cd4e1d62d006cc85367a27bac5
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / Functions / UserSave.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 = "user_save",
12  *  description = @Translation("Rewrites calls to user_save()."),
13  *  fixme = @Translation("user_save() is now a method of the user entity.")
14  * )
15  */
16 class UserSave extends FunctionCallModifier {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function rewrite(FunctionCallNode $call, TargetInterface $target) {
22     $arguments = $call->getArguments();
23
24     if (sizeof($arguments) == 1) {
25       return ObjectMethodCallNode::create(clone $arguments[0], 'save');
26     }
27   }
28
29 }