<?php

namespace CouponsPlus\App\Coupon\Tree\Sets;

use CouponsPlus\App\Conditions\ItemsSet;
use CouponsPlus\App\Coupon\Tree\Sets\Abilities\ItemsSetSorterInterface;
use CouponsPlus\App\Coupon\Tree\Sets\Abilities\AscendingItemsSetSorterInterface;

class AscendingItemsSorter implements ItemsSetSorterInterface
{
    protected AscendingItemsSetSorterInterface $ascendingItemsSetSorter;

    public function __construct(AscendingItemsSetSorterInterface $ascendingItemsSetSorter)
    {
        $this->ascendingItemsSetSorter = $ascendingItemsSetSorter;
    }

    public function sort(ItemsSet $itemsSet): array
    {
        return $this->ascendingItemsSetSorter->sortAscending($itemsSet);
    }
}