Same name and namespace in other branches
  1. 8.9.x core/modules/migrate/src/Plugin/migrate/process/Callback.php \Drupal\migrate\Plugin\migrate\process\Callback::transform()
  2. 9 core/modules/migrate/src/Plugin/migrate/process/Callback.php \Drupal\migrate\Plugin\migrate\process\Callback::transform()

File

core/modules/migrate/src/Plugin/migrate/process/Callback.php, line 96

Class

Callback

Namespace

Drupal\migrate\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
  if (!empty($this->configuration['unpack_source'])) {
    if (!is_array($value)) {
      throw new MigrateException(sprintf("When 'unpack_source' is set, the source must be an array. Instead it was of type '%s'", gettype($value)));
    }
    return call_user_func($this->configuration['callable'], ...$value);
  }
  return call_user_func($this->configuration['callable'], $value);
}