<?php
/**
 * Toptex Filter Hook
 *
 * @category   WordPress_Plugin
 * @package    Common
 * @subpackage Hooks
 * @author     miniOrange <info@miniorange.com>
 * @license    MIT/Expat
 * @link       https://plugins.miniorange.com/woocommerce-api-product-sync-with-woocommerce-rest-apis
 */

namespace MOWCPS\Common\Hooks;

use MOWCPS\Common\Constants\Plugin_Filters;
use MOWCPS\Common\Interfaces\Hookable_Interface;
use MOWCPS\Common\Suppliers\Toptex as Toptex_Supplier;

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

/**
 * Class Toptex
 *
 * Handles Toptex filter hook registration
 */
class Toptex implements Hookable_Interface {

	/**
	 * Initialize the Toptex filter hooks.
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Register WordPress hooks.
	 *
	 * @return void
	 */
	public function register_hooks() {
		add_filter(
			Plugin_Filters::FILTER_API_CALL_ALTERATION_FILTER,
			array( Toptex_Supplier::class, 'check_for_retry' ),
			10,
			1
		);
	}
}
