<?php
/**
 * Base class for plugin configuration objects.
 *
 * @package EaLab\WP_Deployer
 */

namespace EaLab\WP_Deployer\includes\configuration;

use EaLab\WP_Deployer\vendor\Dakwamine\Component\ComponentBasedObject;

/**
 * Base class for plugin configuration objects.
 */
abstract class ConfigurationBase extends ComponentBasedObject {
	/**
	 * Sets the order of appearance.
	 *
	 * @return int Greater values mean positioned later.
	 */
	protected static function get_form_priority(): int {
		return 0;
	}

	/**
	 * Prints the form for this configuration.
	 */
	public static function print_form(): void {
		// Override this method to print HTML.
	}

	/**
	 * Call this to enable this configuration.
	 */
	static public function register(): void {
		add_action(
			'deploy_sync_content__print_configuration_form',
			array( static::class, 'print_form' ),
			static::get_form_priority()
		);
	}
}
