<?php
/**
 * RestServiceProvider class.
 *
 * @package DokanKits\Core\DI\Providers
 * @since   3.0.0
 */

namespace DokanKits\Core\DI\Providers;

use DokanKits\Core\DI\BaseServiceProvider;
use DokanKits\REST\Controllers\Version1\DashboardController;
use DokanKits\REST\Controllers\Version1\SettingsController;
use DokanKits\REST\Controllers\Version1\ToolsController;

/**
 * REST Service Provider
 *
 * Registers REST API services with the container
 *
 * @package DokanKits\Core\DI\Providers
 */
class RestServiceProvider extends BaseServiceProvider {

	/**
	 * Services provided by this provider
	 *
	 * @var array
	 */
	protected array $services = array(
		DashboardController::class,
		SettingsController::class,
		ToolsController::class,
	);

	/**
	 * Tags for this provider
	 *
	 * @var array
	 */
	protected array $tags = array( 'rest-service' );

	/**
	 * Register services with the container
	 *
	 * @return void
	 */
	public function register(): void {
		foreach ( $this->services as $service ) {
			$definition = $this->share_with_implements_tags( $service );
			$this->add_tags( $definition, $this->tags );
		}
	}
}
