diff --git a/src/HordeReconfigureFlow.php b/src/HordeReconfigureFlow.php index c04e234..9af3b59 100644 --- a/src/HordeReconfigureFlow.php +++ b/src/HordeReconfigureFlow.php @@ -189,6 +189,8 @@ public function run(): int $mode, ); + $themesHandler->themesCatalog->reset(); + foreach ($hordeThemes as $theme) { // register [$vendorName, $packageName] = explode('/', $theme); diff --git a/src/ThemesCatalog.php b/src/ThemesCatalog.php index a04bad9..af74999 100644 --- a/src/ThemesCatalog.php +++ b/src/ThemesCatalog.php @@ -111,4 +111,15 @@ public function toArray(): array { return $this->catalog; } + + /** + * Clear the in-memory catalog before a full rebuild. + * + * Callers are expected to re-register all currently installed + * theme packages afterwards and call save(). + */ + public function reset(): void + { + $this->catalog = []; + } }