Move onSettingsChange from Bridge service to SettingsChangeHandler

Bridge is a low level service that processes requests and responses to/from Bridge API.
This change is needed so that we can remove dependency on MailPoet\Util\License\Features\Subscribers
service from the Bridge. The dependecy is a higher level service and may easily cause a circular dependency issue.

The SettingsChangeHandler is service for handling side effects
when saving settings. This feels as a better place to put the functionality.
[MAILPOET-5191]
This commit is contained in:
Rostislav Wolny
2023-04-25 14:38:40 +02:00
committed by Veljko V
parent ab19ef92d5
commit cd5a023b35
6 changed files with 82 additions and 67 deletions

View File

@ -150,7 +150,7 @@ class Settings extends APIEndpoint {
// when pending approval, leave this to cron / Key Activation tab logic
if (!$this->servicesChecker->isMailPoetAPIKeyPendingApproval()) {
$this->bridge->onSettingsSave($settings);
$this->settingsChangeHandler->updateBridge($settings);
}
$meta = $this->authorizedEmailsController->onSettingsSave($settings);