Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / RewriterInterface.php
diff --git a/web/modules/contrib/drupalmoduleupgrader/src/RewriterInterface.php b/web/modules/contrib/drupalmoduleupgrader/src/RewriterInterface.php
new file mode 100644 (file)
index 0000000..5f59d41
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\drupalmoduleupgrader;
+
+use Pharborist\Functions\ParameterNode;
+
+/**
+ * Defines a parametric rewriter.
+ *
+ * Parametric rewriters are utility plugins which can alter a function body
+ * in the context of a specific parameter. If a parameter is explicitly defined
+ * as a node, for example, the rewriter can alter the function body so that
+ * $node->nid becomes $node->id(). Rewriters work from property maps defined
+ * in the plugin definition.
+ */
+interface RewriterInterface {
+
+  /**
+   * Parametrically rewrites the function containing the given parameter.
+   *
+   * @param ParameterNode $parameter
+   *  The parameter upon which to base the rewrite. The parameter must be
+   *  attached to a function or method declaration node, or fatal errors will
+   *  likely result.
+   */
+  public function rewrite(ParameterNode $parameter);
+
+}