FormLoadInclude.php in Drupal 7 to 8/9 Module Upgrader 8
File
src/Plugin/DMU/Converter/Functions/FormLoadInclude.php
View source
<?php
namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions;
use Drupal\drupalmoduleupgrader\TargetInterface;
use Pharborist\Functions\FunctionCallNode;
use Pharborist\Objects\ObjectMethodCallNode;
class FormLoadInclude extends FunctionCallModifier {
public function rewrite(FunctionCallNode $call, TargetInterface $target) {
$arguments = $call
->getArguments();
$rewritten = ObjectMethodCallNode::create(clone $arguments[0], 'loadInclude')
->appendArgument(clone $arguments[2])
->appendArgument(clone $arguments[1]);
if (sizeof($arguments) == 4) {
$rewritten
->appendArgument(clone $arguments[3]);
}
return $rewritten;
}
}
Classes
Name |
Description |
FormLoadInclude |
Plugin annotation
@Converter(
id = "form_load_include",
description = @Translation("Rewrites calls to form_load_include().")
) |