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

namespace DokanKits\Core\DI\Providers;

use DokanKits\Core\Data\Models\Settings;
use DokanKits\Core\Data\Stores\SettingsDataStore;
use DokanKits\Core\DI\BaseServiceProvider;

/**
 * Data Store Service Provider
 *
 * Registers data store services with the container
 *
 * @since   3.0.0
 * @package DokanKits\Core\DI\Providers
 */
class DataStoreServiceProvider extends BaseServiceProvider {
	/**
	 * Services provided by this provider
	 *
	 * @var array
	 */
	protected array $services = array(
		Settings::class,
		SettingsDataStore::class,
	);

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

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