Change record status: 
Project: 
Introduced in branch: 
8.4.x
Description: 

To help processing the field formatter type and the field widget type, two new methods have been added to MigrateFieldInterface:

  /**
   * Get the field formatter type from the source.
   *
   * @param \Drupal\migrate\Row $row
   *   The field being migrated.
   *
   * @return string
   *   The field formatter type.
   */
  public function getFieldFormatterType(Row $row);

  /**
   * Get the field widget type from the source.
   *
   * @param \Drupal\migrate\Row $row
   *   The field being migrated.
   *
   * @return string
   *   The field widget type.
   */
  public function getFieldWidgetType(Row $row);

These new methods have also been implemented by the field plugin base class, FieldPluginBase, and are just returning the field formatter type or the field widget type from the source:

  /**
   * {@inheritdoc}
   */
  public function getFieldFormatterType(Row $row) {
    return $row->getSourceProperty('formatter/type');
  }

  /**
   * {@inheritdoc}
   */
  public function getFieldWidgetType(Row $row) {
    return $row->getSourceProperty('widget/type');
  }

This makes it easier to process these properties when a static just won't do the trick.

Impacts: 
Module developers