class Converter in Drupal 7 to 8/9 Module Upgrader 8
Defines a Plugin annotation object for DMU converter plugins.
Converters take Drupal 7 code and do what they can to rewrite it for Drupal 8. When a converter cannot convert something, it can leave a FIXME notice at the affected code informing the developer what still needs to be done. Converters may generate ugly code, but refactoring is not their job. Converts modify the target module in place.
Plugin Namespace: Plugin\DMU\Converter
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\drupalmoduleupgrader\Annotation\Converter
Expanded class hierarchy of Converter
1 string reference to 'Converter'
83 classes are annotated with Converter
- Blocks in src/
Plugin/ DMU/ Converter/ Blocks.php - Plugin annotation @Converter( id = "blocks", description = @Translation("Converts Drupal 7 blocks to plugins."), hook = { "hook_block_configure", "hook_block_info", "hook_block_save", "hook_block_view" }, fixme =…
- CacheGet in src/
Plugin/ DMU/ Converter/ Functions/ CacheGet.php - Plugin annotation @Converter( id = "cache_get", description = @Translation("Rewrites calls to cache_get().") )
- CacheSet in src/
Plugin/ DMU/ Converter/ Functions/ CacheSet.php - Plugin annotation @Converter( id = "cache_set", description = @Translation("Rewrites calls to cache_set().") )
- CommentLoad in src/
Plugin/ DMU/ Converter/ Functions/ CommentLoad.php - Plugin annotation @Converter( id = "comment_load", description = @Translation("Rewrites calls to comment_load()."), fixme = @Translation("comment_load() is now EntityStorageInterface::load().") )
- ContentRoute in src/
Plugin/ DMU/ Routing/ ContentRoute.php - Plugin annotation @Converter( id = "default", description = @Translation("Converts a menu item to a _controller route."), dependencies = { "router.route_provider", "plugin.manager.drupalmoduleupgrader.rewriter" } )
File
- src/
Annotation/ Converter.php, line 21
Namespace
Drupal\drupalmoduleupgrader\AnnotationView source
class Converter extends Plugin {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* A short description of the conversion the plugin performs.
*
* @var string
*/
public $description;
/**
* Hook.
*
* If the plugin converts a hook (or several hooks), the hook(s) it converts
* (without the hook_ prefix).
*
* @var string|string[]
*/
public $hook;
/**
* Optional FIXME.
*
* Optional FIXME notice the converter should leave at code that it cannot
* convert.
*
* @var string
*/
public $fixme;
/**
* Optional documentation links to be included in the FIXME notice.
*
* @var string[]
*/
public $documentation = [];
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Converter:: |
public | property | A short description of the conversion the plugin performs. | |
Converter:: |
public | property | Optional documentation links to be included in the FIXME notice. | |
Converter:: |
public | property | Optional FIXME. | |
Converter:: |
public | property | Hook. | |
Converter:: |
public | property | The plugin ID. | |
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 |