<?php

namespace CouponsPlus\App\Coupon\Tree\Sets;

use CouponsPlus\App\Coupon\Tree\TestableGroup;
use CouponsPlus\App\Conditions\Abilities\TestableComposite;
use CouponsPlus\App\Coupon\Tree\Sets\Abilities\ItemsSetSource;
use CouponsPlus\App\Coupon\Tree\Abilities\TestableCompositeCollection;

class FromTestableCompositeWithCollectionItemsSetSource implements ItemsSetSource
{
    /**
     * @var TestableComposite&TestableCompositeCollection
     */
    protected $testableCompositeWithCollection;

    /**
     * @param TestableComposite&TestableCompositeCollection $testableGroupWithCollection
     */
    public function __construct($testableGroupWithCollection)
    {
        $this->testableCompositeWithCollection = $testableGroupWithCollection;
    }

    public function getTestableComposite()
    {
        return $this->testableCompositeWithCollection;
    }

    public function addTestableComposite(TestableComposite $testableComposite)
    {
        $this->testableCompositeWithCollection->add($testableComposite);
    }
}