<?php

namespace Feedbee\Smp\Collection;

class UniqueCollection extends Collection
{
    /**
     * @param array $values
     * @return \Feedbee\Smp\Collection\Collection
     */
    public function setValues(array $values)
    {
        parent::setValues(array_unique($values, SORT_REGULAR));

        return $this;
    }

    /**
     * @param mixed $value
     * @return \Feedbee\Smp\Collection\Collection
     */
    public function addValue($value)
    {
        if (!$this->hasValue($value)) {
            parent::addValue($value);
        }

        return $this;
    }
}
<?php

namespace Feedbee\Smp\Collection;

class UniqueCollection extends Collection
{
    /**
     * @param array $values
     * @return \Feedbee\Smp\Collection\Collection
     */
    public function setValues(array $values)
    {
        foreach ($values as $value) {
            $this->addValue($value);
        }

        return $this;
    }

    /**
     * @param mixed $value
     * @return \Feedbee\Smp\Collection\Collection
     */
    public function addValue($value)
    {
        if (!$this->hasValue($value)) {
            parent::addValue($value);
        }

        return $this;
    }
}
Fix unizue collection object compare bug
Fix unizue collection object compare bug
