3 namespace Drupal\drupalmoduleupgrader;
5 use Pharborist\Functions\ParameterNode;
8 * Defines a parametric rewriter.
10 * Parametric rewriters are utility plugins which can alter a function body
11 * in the context of a specific parameter. If a parameter is explicitly defined
12 * as a node, for example, the rewriter can alter the function body so that
13 * $node->nid becomes $node->id(). Rewriters work from property maps defined
14 * in the plugin definition.
16 interface RewriterInterface {
19 * Parametrically rewrites the function containing the given parameter.
21 * @param ParameterNode $parameter
22 * The parameter upon which to base the rewrite. The parameter must be
23 * attached to a function or method declaration node, or fatal errors will
26 public function rewrite(ParameterNode $parameter);