<?php

namespace CouponsPlus\App\Handlers;

use CouponsPlus\App\Coupon\Tree\Cart\AutoAddedItems;
use CouponsPlus\Original\Events\Handler\EventHandler;

Class AutoAdderManagerStateManager extends EventHandler
{
    protected $numberOfArguments = 1;
    protected $priority = 10;

    public function execute()
    {
        add_action('woocommerce_remove_cart_item', [$this, 'deregisterCartItem']);
    }

    public function deregisterCartItem(string $cart_item_key)
    {
        AutoAddedItems::deregisterRemovedItem($cart_item_key);
    }
}