diff --git a/src/Plugin/migrate/process/Gate.php b/src/Plugin/migrate/process/Gate.php index 9cdf79574af80fae4758229ef1ebdd412bb9204e..3cb8f7af3d11ce668c8e27111a2f185b8e050286 100644 --- a/src/Plugin/migrate/process/Gate.php +++ b/src/Plugin/migrate/process/Gate.php @@ -85,20 +85,20 @@ class Gate extends ProcessPluginBase { * {@inheritdoc} */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { - if (empty($this->configuration['valid_keys']) && !array_key_exists('valid_keys', $this->configuration)) { + if (!array_key_exists('valid_keys', $this->configuration)) { throw new MigrateException('Gate plugin is missing valid_keys configuration.'); } - if (empty($this->configuration['use_as_key']) && !array_key_exists('use_as_key', $this->configuration)) { + if (!array_key_exists('use_as_key', $this->configuration)) { throw new MigrateException('Gate plugin is missing use_as_key configuration.'); } - if (empty($this->configuration['key_direction']) && !array_key_exists('key_direction', $this->configuration)) { + if (!array_key_exists('key_direction', $this->configuration)) { throw new MigrateException('Gate plugin is missing key_direction configuration.'); } if (!in_array($this->configuration['key_direction'], ['lock', 'unlock'], TRUE)) { throw new MigrateException('Gate plugin only accepts the following values for key_direction: lock and unlock.'); } - $valid_keys = is_array($this->configuration['valid_keys']) ? $this->configuration['valid_keys'] : [$this->configuration['valid_keys']]; + $valid_keys = (array) $this->configuration['valid_keys']; $key = $row->get($this->configuration['use_as_key']); $key_is_valid = in_array($key, $valid_keys, TRUE); $key_direction = $this->configuration['key_direction'];