diff --git a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php index ed3eb3f..683b4fe 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php +++ b/core/modules/migrate/src/Plugin/migrate/process/StaticMap.php @@ -12,16 +12,17 @@ /** * Changes the source value based on a static lookup map. * - * The static_map source plugin allows looking up a value based on a map - * specified in the configuration. + * Maps the input value to another value using an associative array specified in + * the configuration. * * Available configuration keys: * - source: The input value - either a scalar or an array. - * - map: An array (of 1 or more dimensions) that identifies the link between + * - map: An array (of 1 or more dimensions) that identifies the mapping between * source values and destination values. * - bypass: (optional) Whether the plugin should proceed when the source is not * found in the map array. Defaults to FALSE. - * - TRUE: Do not throw an exception, return the source value. + * - TRUE: Return the unmodified input value, or another default value, if one + * is specified. * - FALSE: Throw a MigrateSkipRowException. * - default_value: (optional) The value to return if the source is not found in * the map array. @@ -62,13 +63,10 @@ * @endcode * * If the value of the source properties module and delta are "filter" and "2" - * respectively, then the value of the destination id will be "filter_url". By - * default, if a value is not found in the map, an exception is thrown. This is - * desirable in the above example. When static_map is used to just rename a few - * things and leave the others, a "bypass: true" option can be added. In this - * case, the source value is used unchanged. - * - * Also, a default_value can be provided. + * respectively, then the returned value will be "filter_url". By default, if a + * value is not found in the map, an exception is thrown. When static_map is + * used to just rename a few things and leave the others, a "bypass: true" + * option can be added. In this case, the source value is used unchanged. * * @code * process: @@ -94,23 +92,7 @@ class StaticMap extends ProcessPluginBase { /** - * Performs the associated process. - * - * @param mixed $value - * The input value. - * @param \Drupal\migrate\MigrateExecutableInterface $migrate_executable - * The migration in which this process is being executed. - * @param \Drupal\migrate\Row $row - * The row from the source to process. - * @param string $destination_property - * The destination property currently worked on. This is only used together - * with the $row above. - * - * @return string - * The sub string of $value. - * - * @throws \Drupal\migrate\MigrateException - * @throws \Drupal\migrate\MigrateSkipRowException + * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { $new_value = $value;