<?php
/**
 * Field provider categories.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Provider;

/**
 * String constants for ProviderCategory values.
 */
class ProviderCategory {

	public const EXPLICIT_ADAPTER = 'explicit_adapter';
	public const WORDPRESS_CORE   = 'wordpress_core';
	public const WOOCOMMERCE_CORE = 'woocommerce_core';
	public const REGISTERED       = 'registered';
	public const DISCOVERY        = 'discovery';
	public const RAW_METADATA     = 'raw_metadata';
	public const SAMPLE           = 'sample';
	public static function priority( string $category ): int {
		switch ( $category ) {
			case self::EXPLICIT_ADAPTER:
				return 500;
			case self::WORDPRESS_CORE:
				return 450;
			case self::WOOCOMMERCE_CORE:
				return 400;
			case self::REGISTERED:
				return 300;
			case self::DISCOVERY:
				return 200;
			case self::RAW_METADATA:
				return 100;
			case self::SAMPLE:
				return 0;
			default:
				throw new \InvalidArgumentException( 'Unknown provider category.' );
		}
	}
}
