You are here

class Rewriter in Drupal 7 to 8/9 Module Upgrader 8

Defines a Plugin annotation object for parametric rewriters.

Parametric rewriters are intelligent search-and-replace plugins which act on a function body based on one of the function's parameters. The parameter type must be known ahead of time.

Plugin Namespace: Plugin\DMU\Rewriter

Hierarchy

Expanded class hierarchy of Rewriter

1 string reference to 'Rewriter'
drupalmoduleupgrader.services.yml in ./drupalmoduleupgrader.services.yml
drupalmoduleupgrader.services.yml
2 classes are annotated with Rewriter
FormState in src/Plugin/DMU/Rewriter/FormState.php
Plugin annotation @Rewriter( id = "form_state", type_hint = "\Drupal\Core\Form\FormStateInterface", properties = { "always_process" = { "get" = "getAlwaysProcess", "set" = "setAlwaysProcess" }, "build_info" = { "get" =…
Generic in src/Plugin/DMU/Rewriter/Generic.php
Plugin annotation @Rewriter( id = "_rewriter", deriver = "\Drupal\drupalmoduleupgrader\Plugin\DMU\Rewriter\GenericDeriver" )

File

src/Annotation/Rewriter.php, line 18

Namespace

Drupal\drupalmoduleupgrader\Annotation
View source
class Rewriter extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * Optional type hint to set on the parameter.
   *
   * @var
   */
  public $type_hint;

  /**
   * Properties known to the rewriter, keyed by property.
   *
   * Each property can have 'get' and 'set' keys, which are the corresponding
   * getter and setter methods to replace the property with.
   * The 'get' key is required; the setter is only needed if it's possible to
   * set the property at all (for example, an entity ID property would not have
   * a setter).
   *
   * @var array
   */
  public $properties = [];

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2
Rewriter::$id public property The plugin ID.
Rewriter::$properties public property Properties known to the rewriter, keyed by property.
Rewriter::$type_hint public property Optional type hint to set on the parameter.