protected function arrayHasKey(&$source, $key)
    {
        if (!$key || !is_array($source)) {
            return false;
        }

        if (array_key_exists($key, $source)) {
            return true;
        }

        $current =& $source;
        foreach (explode('.', $key) as $segment) {
            if (!array_key_exists($segment, $current)) {
                return false;
            }
            $current =& $current[$segment];
        }

        return true;
    }