<?php
/**
 * Config provider manager for "value_handler.option".
 *
 * @package Ealab\Deployer
 */

namespace EaLab\WP_Deployer\vendor\Ealab\Deployer\Tracking\Config\ValueHandlerOption;

use EaLab\WP_Deployer\vendor\Ealab\Deployer\Tracking\Config\ConfigProviderManagerBase;
use EaLab\WP_Deployer\vendor\Ealab\Deployer\Tracking\Config\StaticConfigProvider;

/**
 * Config provider manager for "value_handler.option".
 */
class ValueHandlerOptionConfigProviderManager extends ConfigProviderManagerBase {
	/**
	 * {@inheritDoc}
	 */
	protected function getBaseConfigProviderDefinitions(): array {
		$providers = array();

		// Default config in case the repository config is not available.
		$providers[] = array(
			'class'   => StaticConfigProvider::class,
			'options' => array(
				'config' => array(
					''            => array(
						'options' => array(
							'options.option_value' => array(
								'fields' => array(
									'home'    => array(
										'exclude' => false,
									),
									'siteurl' => array(
										'exclude' => true,
									),
								),
							),
						),
					),
					'deploy-sync-content' => array(
						'options' => array(
							'options.option_value' => array(
								'fields' => array(
									'action_scheduler_hybrid_store_demarkation'  => array( 'exclude' => true ),
									'action_scheduler_lock_async-request-runner' => array( 'exclude' => true ),
									'action_scheduler_migration_status'          => array( 'exclude' => true ),
								),
							),
						),
					),
				),
			),
		);

		$providers[] = array( 'class' => ValueHandlerOptionRepositoryConfigProvider::class );

		return $providers;
	}

	/**
	 * {@inheritDoc}
	 */
	public static function getManagerId(): string {
		return 'value_handler.option';
	}
}
