configuration['search'])) { throw new MigrateException('"search" must be configured.'); } if (!isset($this->configuration['replace'])) { throw new MigrateException('"replace" must be configured.'); } $this->multiple = is_array($value); $this->configuration += [ 'case_insensitive' => FALSE, 'regex' => FALSE, ]; $function = "str_replace"; if ($this->configuration['case_insensitive']) { $function = 'str_ireplace'; } if ($this->configuration['regex']) { $function = 'preg_replace'; } return $function($this->configuration['search'], $this->configuration['replace'], $value); } /** * {@inheritdoc} */ public function multiple() { return $this->multiple; } }