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

namespace DokanKits\Core\DI\Providers;

use DokanKits\Admin\Hooks;
use DokanKits\Core\Bootstrap;
use DokanKits\Core\DI\BaseServiceProvider;
use DokanKits\Core\TemplateManager;
use DokanKits\Utils\Logger;

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

	/**
	 * Services provided by this provider
	 *
	 * @var array
	 */
	protected array $services = array(
		Hooks::class,
		TemplateManager::class,
		Logger::class,
		Bootstrap::class,
	);

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

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