3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
5 use Drupal\drupalmoduleupgrader\TargetInterface;
6 use Pharborist\Functions\FunctionCallNode;
7 use Pharborist\Objects\ObjectMethodCallNode;
11 * id = "form_load_include",
12 * description = @Translation("Rewrites calls to form_load_include().")
15 class FormLoadInclude extends FunctionCallModifier {
20 public function rewrite(FunctionCallNode $call, TargetInterface $target) {
21 $arguments = $call->getArguments();
23 $rewritten = ObjectMethodCallNode::create(clone $arguments[0], 'loadInclude')
24 ->appendArgument(clone $arguments[2])
25 ->appendArgument(clone $arguments[1]);
27 if (sizeof($arguments) == 4) {
28 $rewritten->appendArgument(clone $arguments[3]);