Horde_ActiveSync_Wbxml_Decoder::_getAttributes PHP Method

_getAttributes() protected method

Get the element attributes
protected _getAttributes ( ) : mixed
return mixed The value of the element's attributes.
    protected function _getAttributes()
    {
        $attributes = array();
        $attr = '';
        while (1) {
            $byte = $this->_getByte();
            if (count($byte) == 0) {
                break;
            }
            switch ($byte) {
                case self::SWITCH_PAGE:
                    $this->_attrcp = $this->_getByte();
                    break;
                case self::END:
                    if ($attr != '') {
                        $attributes += $this->_splitAttribute($attr);
                    }
                    return $attributes;
                case self::ENTITY:
                    $entity = $this->_getMBUInt();
                    $attr .= $this->entityToCharset($entity);
                    return $element;
                case self::STR_I:
                    $attr .= $this->_getTermStr();
                    return $element;
                case self::LITERAL:
                    if ($attr != '') {
                        $attributes += $this->_splitAttribute($attr);
                    }
                    $attr = $this->_getStringTableEntry($this->_getMBUInt());
                    return $element;
                case self::EXT_I_0:
                case self::EXT_I_1:
                case self::EXT_I_2:
                    $this->_getTermStr();
                    continue;
                case self::PI:
                case self::LITERAL_C:
                    // Invalid
                    return false;
                case self::EXT_T_0:
                case self::EXT_T_1:
                case self::EXT_T_2:
                    $this->_getMBUInt();
                    continue;
                case self::STR_T:
                    $attr .= $this->_getStringTableEntry($this->_getMBUInt());
                    return $element;
                case self::LITERAL_A:
                    return false;
                case self::EXT_0:
                case self::EXT_1:
                case self::EXT_2:
                    continue;
                case self::OPAQUE:
                    $length = $this->_getMBUInt();
                    $attr .= $this->_getOpaque($length);
                    return $element;
                case self::LITERAL_AC:
                    return false;
                default:
                    if ($byte < 128) {
                        if ($attr != '') {
                            $attributes += $this->_splitAttribute($attr);
                            $attr = '';
                        }
                    }
                    $attr .= $this->_getMapping($this->_attrcp, $byte);
                    break;
            }
        }
    }