public function contains($needle, ?string $key = null) : bool
    {
        $value = $this->get($key);

        if (!is_array($value)) {
            throw new InvalidArgumentException(
                'method contains() should be called on array'
            );
        }

        return in_array($needle, $value);
    }