<?php

declare (strict_types=1);
namespace Worldline\Vendor;

use Worldline\Vendor\Worldline\WorldlineForWoocommerce\Uninstall\DatabaseCleaner;
use Worldline\Vendor\Worldline\WorldlineForWoocommerce\Uninstall\UninstallModule;
use Worldline\Vendor\Worldline\WorldlineForWoocommerce\WorldlinePaymentGateway\GatewayIds;
use Worldline\Vendor\Psr\Container\ContainerInterface;
use Worldline\Vendor\Dhii\Services\Factory;
return static function () : array {
    return ['uninstall.worldline-all-option-names' => static function (ContainerInterface $container) : array {
        $gatewaySettingOptions = \array_map(static function (string $gatewayId) : string {
            return "woocommerce_{$gatewayId}_settings";
        }, GatewayIds::ALL);
        return [...$gatewaySettingOptions];
    }, 'uninstall.worldline-all-cleanup-action-names' => static function (ContainerInterface $container) : array {
        return [];
    }, 'uninstall.worldline-all-scheduled-action-names' => static function () : array {
        return ['wlop_update_status', 'wlop_cleanup_pending_orders'];
    }, 'uninstall.db-cleaner' => new Factory(['uninstall.worldline-all-option-names', 'uninstall.worldline-all-scheduled-action-names', 'uninstall.worldline-all-cleanup-action-names'], static function (array $optionNames, array $actionNames, array $scheduledActionNames) : DatabaseCleaner {
        return new DatabaseCleaner($optionNames, $actionNames, $scheduledActionNames);
    }), 'uninstall.db-cleaner-url' => static function () : string {
        $nonce = \wp_create_nonce(UninstallModule::CLEAN_DB_NONCE);
        return \add_query_arg([UninstallModule::CLEAN_DB_ACTION => '1', UninstallModule::CLEAN_DB_NONCE => $nonce]);
    }];
};
