* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 */ declare(strict_types=1); namespace PrestaShop\Module\Mbo\Distribution\Config\CommandHandler; use PrestaShop\Module\Mbo\Distribution\Config\Applier; use PrestaShop\Module\Mbo\Distribution\Config\Command\ConfigChangeCommand; use PrestaShop\Module\Mbo\Distribution\Config\Factory; final class ConfigChangeCommandHandler { /** * @var Factory */ private $configFactory; /** * @var Applier */ private $configApplier; public function __construct(Factory $configFactory, Applier $configApplier) { $this->configFactory = $configFactory; $this->configApplier = $configApplier; } public function handle(ConfigChangeCommand $command): void { $collection = $this->configFactory->buildAndSave($command->getConfig()); $this->configApplier->apply($collection, $command->getPsVersion(), $command->getMboVersion()); } }