Return only unique items from the collection array.

@param  string|callable|null  $key
@param  bool  $strict
@return static
170905
public function unique($key = null, $strict = false)
    {
        $callback = $this->valueRetriever($key);

        $exists = [];

        return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
            if (in_array($id = $callback($item, $key), $exists, $strict)) {
                return true;
            }

            $exists[] = $id;
        });
    }
438525
public function forever($key, $value, $strict = true) {
        return $this->set($key, $value, 0, $strict);
    }
829611
public function isLazy($key= '') {
        $lazy = false;
        if (empty($key)) {
            $lazy = (count($this->_lazy) > 0);
        } else {
            $key = $this->getField($key, true);
            if ($key !== false) {
                $lazy = in_array($key, $this->_lazy);
            }
        }
        return $lazy;
    }
958552
public function keys(?string $search = null, ?bool $strict = null): Collection
    {
        if (func_get_args()['search'] ?? false) {
            return array_keys($this->storage, $search, (bool) $strict);
        }

        return new static(array_keys($this->storage));
    }
594217
public function chainingGetMethod($key)
    {
        $newCollection = new self();

        foreach ($this->items as $item) {
            // This item is a collection
            if ($item instanceof self) {
                foreach ($item as $subItem) {
                    $newCollection->put($newCollection->count(), $subItem->$key);
                }

                continue;
            }

            // The next item in the chain is a collection
            if (is_object($item) && ! $item instanceof self && $item->$key instanceof self) {
                foreach ($item->$key as $subItem) {
                    $newCollection->put($newCollection->count(), $subItem);
                }

                continue;
            }

            $newCollection->put($newCollection->count(), $item->$key);
        }

        return $newCollection;
    }
570608
public function getRequired(string $key)
    {
        if (!$this->has($key)) {
            throw new \InvalidArgumentException('Element ' . $key . ' does not exist');
        }

        return $this->collection[$this->keyMap[strtolower($key)]];
    }
437682
public static function has($key, $strict = false)
    {
        $isset = isset($_COOKIE[$key]);

        if (!$strict) {
            return $isset;
        }

        if ($isset) {
            $isset = $isset && !empty($_COOKIE[$key]);
        }

        return $isset;
    }
935661
public function get($key, $strict = true, $default = null) {
        $value = $this->memcache->get($key);
        if (false === $value && $strict) {
            throw new CacheMissException($key);
        }
        return $default;
    }
230905
public static function contains($haystack, $needle, $strict = false)
    {
        if ($haystack instanceof \ArrayObject) {
            $haystack = $haystack->getArrayCopy();
        }

        if ($haystack instanceof \SplFixedArray) {
            $haystack = $haystack->toArray();
        }

        \settype($strict, 'bool');

        if (false === $strict) {
            return \in_array($needle, $haystack, false);
        }

        return \in_array($needle, $haystack, true);
    }
82401
public function where($key, $value, $strict = true)
    {
        return $this->filter(function ($item) use ($key, $value, $strict) {
            return $strict ? ArrayHelper::getValue($item, $key) === $value
                : ArrayHelper::getValue($item, $key) == $value;
        });
    }
300496
public function groupBy(string $key)
    {
        $items = [];
        foreach ($this->items as $item) {
            $items[$item[$key]][] = $item;
        }
        return new static($items);
    }
1228602
public function search($value, bool $strict = false)
    {
        $ord = \array_search($value, $this->map, $strict);
        if ($ord !== false) {
            return ($this->enumeration)::byOrdinal($ord);
        }

        return null;
    }
1088089
public function only($key)
    {
        $keys = is_array($key) ? $key : func_get_args();

        return new static($this->classname, $this->filterByKeys($keys));
    }
249161
public static function get($key = false) {

        if (isset($_GET)) {

            if ($key) {

                return $_GET[$key];
            }

            return $_GET;
        }

        return false;
    }
399360
public function offsetGet($key)
    {
        $result = array_get($this->items, $key);

        if (is_array($result))
            return new static($result);

        return $result;
    }
829787
public function has($key, $strict = false)
    {
        // When $strict is true, he check $key not how a key but a value.
        $isset = isset($this->storage[$key]);

        if ($isset) {
            if ($strict === true) {
                $isset = $isset && !empty($this->storage[$key]);
            }
        }

        return $isset;
    }
1123190
public function get_restriction($key = 0)
	{
		$restrictions = $this->get_restrictions();
		if (isset($restrictions[$key]))
		{
			return $restrictions[$key];
		}

		return null;
	}