Skip to content

Commit 1f70c48

Browse files
committed
Adjust flow; avoid unnecessary listing.
1 parent 510e7fd commit 1f70c48

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/EventSubscriber/ConfigTransformationEventSubscriber.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717
*/
1818
class ConfigTransformationEventSubscriber implements EventSubscriberInterface, ContainerInjectionInterface {
1919

20-
const PRIORITY = 250;
20+
protected const PRIORITY = 250;
21+
22+
protected const PREFIXES_TO_IGNORE = [
23+
'migrate_plus.migration.isi__',
24+
'migrate_plus.migration_group.isi__',
25+
'islandora_spreadsheet_ingest.request.',
26+
];
2127

2228
/**
2329
* Constructor.
@@ -55,8 +61,8 @@ public static function getSubscribedEvents() : array {
5561
*/
5662
public function onExportTransform(StorageTransformEvent $event) : void {
5763
$storage = $event->getStorage();
58-
foreach ($this->toIgnore($storage) as $name) {
59-
$storage->delete($name);
64+
foreach (static::PREFIXES_TO_IGNORE as $prefix) {
65+
$storage->deleteAll($prefix);
6066
}
6167
}
6268

@@ -93,9 +99,9 @@ public function onImportTransform(StorageTransformEvent $event) : void {
9399
* The names of the configs that should never be changed on imports/exports.
94100
*/
95101
protected static function toIgnore(StorageInterface $storage) : \Generator {
96-
yield from $storage->listAll('migrate_plus.migration.isi__');
97-
yield from $storage->listAll('migrate_plus.migration_group.isi__');
98-
yield from $storage->listAll('islandora_spreadsheet_ingest.request.');
102+
foreach (static::PREFIXES_TO_IGNORE as $prefix) {
103+
yield from $storage->listAll($prefix);
104+
}
99105
}
100106

101107
}

0 commit comments

Comments
 (0)