diff --git a/core/modules/migrate/src/Plugin/migrate/process/StrReplace.php b/core/modules/migrate/src/Plugin/migrate/process/StrReplace.php index 81ce382..754570b 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/StrReplace.php +++ b/core/modules/migrate/src/Plugin/migrate/process/StrReplace.php @@ -19,6 +19,7 @@ * ) * * To do a simple hardcoded string replace use the following: + * * @code * field_text: * plugin: str_replace @@ -83,28 +84,28 @@ * apply. This means that you can provide arrays as values. */ class StrReplace extends ProcessPluginBase implements ContainerFactoryPluginInterface { - + /** * Flag indicating whether there are multiple values. * * @var bool */ protected $multiple; - + /** * The migration. * * @var \Drupal\migrate\Plugin\MigrationInterface */ protected $migration; - + /** * The Migration Process Plugin Manager. * * @var \Drupal\migrate\Plugin\MigratePluginManager */ protected $processPluginManager; - + /** * Constructs a StrReplace plugin. * @@ -124,7 +125,7 @@ public function __construct(array $configuration, $pluginId, $pluginDefinition, $this->migration = $migration; $this->processPluginManager = $process_plugin_manager; } - + /** * {@inheritdoc} */ @@ -137,31 +138,30 @@ public static function create(ContainerInterface $container, array $configuratio $container->get('plugin.manager.migrate.process') ); } - + /** * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { if (!isset($this->configuration['search'])) { - throw new MigrateException('search must be configured.'); + throw new MigrateException('"search" must be configured.'); } if (!isset($this->configuration['replace'])) { - throw new MigrateException('replace must be configured.'); + throw new MigrateException('"replace" must be configured.'); } $this->multiple = is_array($value); $function = "str_replace"; if ($this->configuration['case_insensitive']) { $function = 'str_ireplace'; } - $result = $function($this->configuration['search'], $this->configuration['replace'], $value); - return $result; + return $function($this->configuration['search'], $this->configuration['replace'], $value); } - + /** * {@inheritdoc} */ public function multiple() { return $this->multiple; } - + }