Skip to content
Snippets Groups Projects

Issue #3261275: Throw consistent exceptions on \Drupal\migrate_plus\Plugin\migrate\process\SkipOnValue process plugin

Merged Issue #3261275: Throw consistent exceptions on \Drupal\migrate_plus\Plugin\migrate\process\SkipOnValue process plugin
All threads resolved!
All threads resolved!
Files
2
@@ -61,11 +61,18 @@ class SkipOnValue extends ProcessPluginBase {
@@ -61,11 +61,18 @@ class SkipOnValue extends ProcessPluginBase {
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public function row($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
if (empty($this->configuration['value']) && !array_key_exists('value', $this->configuration)) {
if (empty($configuration['value']) && !array_key_exists('value', $configuration)) {
throw new MigrateException('Skip on value plugin is missing value configuration.');
throw new \InvalidArgumentException('Skip on value plugin is missing value configuration.');
}
}
 
parent::__construct($configuration, $plugin_id, $plugin_definition);
 
}
 
 
/**
 
* {@inheritdoc}
 
*/
 
public function row($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (is_array($this->configuration['value'])) {
if (is_array($this->configuration['value'])) {
$value_in_array = FALSE;
$value_in_array = FALSE;
$not_equals = isset($this->configuration['not_equals']);
$not_equals = isset($this->configuration['not_equals']);
@@ -89,10 +96,6 @@ class SkipOnValue extends ProcessPluginBase {
@@ -89,10 +96,6 @@ class SkipOnValue extends ProcessPluginBase {
* {@inheritdoc}
* {@inheritdoc}
*/
*/
public function process($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
public function process($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (empty($this->configuration['value']) && !array_key_exists('value', $this->configuration)) {
throw new MigrateException('Skip on value plugin is missing value configuration.');
}
if (is_array($this->configuration['value'])) {
if (is_array($this->configuration['value'])) {
$value_in_array = FALSE;
$value_in_array = FALSE;
$not_equals = isset($this->configuration['not_equals']);
$not_equals = isset($this->configuration['not_equals']);
Loading