public static function toMap($string)
    {
        if (null === $string) {
            return null;
        } elseif ('' === $string) {
            return [];
        }

        $map = [];
        foreach (self::toList($string) as $keyValue) {
            if (strstr($keyValue, ':') !== false) {
                list($key, $value) = explode(':', $keyValue, 2);
                $map[$key]         = $value;
            } else {
                $map[] = $keyValue;
            }
        }

        return $map;
    }