You are here

interface RewriterInterface in Drupal 7 to 8/9 Module Upgrader 8

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.

Hierarchy

Expanded class hierarchy of RewriterInterface

All classes that implement RewriterInterface

3 files declare their use of RewriterInterface
FormConverter.php in src/Utility/FormConverter.php
Generic.php in src/Plugin/DMU/Rewriter/Generic.php
UserHooks.php in src/Plugin/DMU/Converter/UserHooks.php
1 string reference to 'RewriterInterface'
drupalmoduleupgrader.services.yml in ./drupalmoduleupgrader.services.yml
drupalmoduleupgrader.services.yml

File

src/RewriterInterface.php, line 16

Namespace

Drupal\drupalmoduleupgrader
View source
interface RewriterInterface {

  /**
   * Parametrically rewrites the function containing the given parameter.
   *
   * @param \Pharborist\Functions\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);

}

Members

Namesort descending Modifiers Type Description Overrides
RewriterInterface::rewrite public function Parametrically rewrites the function containing the given parameter. 1