You are here

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

Expanded class hierarchy of Converter

1 string reference to 'Converter'
drupalmoduleupgrader.services.yml in ./drupalmoduleupgrader.services.yml
drupalmoduleupgrader.services.yml
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" } )

... See full list

File

src/Annotation/Converter.php, line 21

Namespace

Drupal\drupalmoduleupgrader\Annotation
View 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

Namesort descending Modifiers Type Description Overrides
Converter::$description public property A short description of the conversion the plugin performs.
Converter::$documentation public property Optional documentation links to be included in the FIXME notice.
Converter::$fixme public property Optional FIXME.
Converter::$hook public property Hook.
Converter::$id public property The plugin ID.
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