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
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\drupalmoduleupgrader\Annotation\Rewriter
Expanded class hierarchy of Rewriter
1 string reference to 'Rewriter'
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\AnnotationView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function | Constructs a Plugin object. | 2 |
Rewriter:: |
public | property | The plugin ID. | |
Rewriter:: |
public | property | Properties known to the rewriter, keyed by property. | |
Rewriter:: |
public | property | Optional type hint to set on the parameter. |