Skip to content

Commit 898c83d

Browse files
committed
Fix incorrect method call and ignored return value
1 parent e484889 commit 898c83d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Services/ApiKeyService.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ function ( $default_params ) {
9090
if (empty($currentMode)) {
9191
update_option('monei_apikey_mode', 'test'); // Default to test if both exist
9292
}
93-
$this->cleanup_legacy_keys($default_params);
94-
return $default_params;
93+
return $this->cleanup_legacy_keys($default_params);
9594
}
9695

9796
// Scenario 2 & 3: Partial new keys exist - try to complete them
@@ -146,15 +145,21 @@ function ( $default_params ) {
146145

147146
// Clean up legacy keys if we did any migration
148147
if ($needsMigration) {
149-
$this->cleanup_legacy_keys($default_params);
148+
$default_params = $this->cleanup_legacy_keys($default_params);
150149
}
151150

152151
return $default_params;
153152
},
154153
10
155154
);
156155
}
157-
function cleanup_legacy_keys($settings_array) {
156+
/**
157+
* Clean up legacy API keys from both standalone options and settings array.
158+
*
159+
* @param array $settings_array The settings array to clean
160+
* @return array The cleaned settings array
161+
*/
162+
private function cleanup_legacy_keys($settings_array) {
158163
// Remove legacy standalone options
159164
delete_option('monei_apikey');
160165
delete_option('monei_accountid');

0 commit comments

Comments
 (0)