Skip to content

Commit

Permalink
Update according to Adam's feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismacdonaldw committed Aug 26, 2024
1 parent 666581e commit 9577139
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/migrate/process/AssembleDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
'range_start' => $this->configuration['range_start'] ?? NULL,
'range_end' => $this->configuration['range_end'] ?? NULL,
];
if (empty($this->dates['single_date']) && !$this->dates['range_start'] && !$this->dates['range_end']) {
if (!array_filter($this->dates)) {
throw new MigrateException('Plugin dgi_migrate.process.assemble_date requires at least one of the three properties, "single_date", "range_start", or "range_end" to be provided.');
}
$indicate_open = $this->configuration['indicate_open'] ?? FALSE;
Expand Down Expand Up @@ -126,7 +126,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
}

if (count($return_dates) === 1) {
return $return_dates[0];
return reset($return_dates);
}

return $return_dates;
Expand Down

0 comments on commit 9577139

Please sign in to comment.