<?php
/**
 * Integration controller for managing integrations.
 *
 * @package Awesomemotive\Rewardswp\Controllers
 * @since 1.0.0
 */

namespace Awesomemotive\Rewardswp\Controllers;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use Awesomemotive\Rewardswp\Interfaces\IntegrationInterface;
use Awesomemotive\Rewardswp\Interfaces\ControllerInterface;

class IntegrationController implements ControllerInterface {
	private IntegrationInterface $integration;

	/**
	 * Constructor.
	 *
	 * The integration controller class will be automatically injected based on the site's settings.
	 *
	 * @see \Awesomemotive\Rewardswp\Container::get_definitions for details on how this is set.
	 *
	 * @since 1.0.0
	 *
	 * @param IntegrationInterface $integration The injected integration controller.
	 */
	public function __construct( IntegrationInterface $integration ) {
		$this->integration = $integration;
	}

	/**
	 * Run integration hooks.
	 *
	 * @since 1.0.0
	 *
	 * @return void
	 */
	public function init(): void {
		$this->integration->init();
	}
}
