<?php
/**
 * @license GPL-2.0-or-later
 *
 * Modified using Strauss.
 * @see https://github.com/BrianHenryIE/strauss
 */ declare( strict_types=1 );

namespace RCP\LiquidWeb\Harbor\Admin;

use RCP\LiquidWeb\Harbor\Contracts\Abstract_Provider;

class Provider extends Abstract_Provider {
	/**
	 * Register the service provider.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function register() {
		$this->container->singleton( Feature_Manager_Page::class );

		add_action( 'admin_menu', [ $this, 'register_unified_feature_manager_page' ], 20, 0 );
	}

	/**
	 * Registers the unified feature manager page if this instance
	 * has the highest Harbor version among all active instances.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function register_unified_feature_manager_page(): void {
		$this->container->get( Feature_Manager_Page::class )->maybe_register_page();
	}
}
