private static function decodeSimple($additional, &$bytes)
    {
        switch($additional)
        {
            case AdditionalType::SIMPLE_FALSE:
                return false;

            case AdditionalType::SIMPLE_TRUE:
                return true;

            case AdditionalType::SIMPLE_UNDEFINED: // Deliberate fall-through
            case AdditionalType::SIMPLE_NULL:
                return null;

            case AdditionalType::FLOAT_16:
                return self::decodeDouble(2, $bytes);

            case AdditionalType::FLOAT_32:
                return self::decodeDouble(4, $bytes);

            case AdditionalType::FLOAT_64:
                return self::decodeDouble(8, $bytes);

            default:
                throw new CborException("$additional isn't a valid CBOR Additional Type for the Simple Major Type.");
        }
    }
private static function decodeSimple($additional, &$bytes)
    {
        switch($additional)
        {
            case AdditionalType::SIMPLE_FALSE:
                return false;

            case AdditionalType::SIMPLE_TRUE:
                return true;

            case AdditionalType::SIMPLE_UNDEFINED: // Deliberate fall-through
            case AdditionalType::SIMPLE_NULL:
                return null;

            case AdditionalType::FLOAT_16:
                return self::decodeDouble(2, $bytes);

            case AdditionalType::FLOAT_32:
                return self::decodeDouble(4, $bytes);

            case AdditionalType::FLOAT_64:
                return self::decodeDouble(8, $bytes);

            default:
                throw new CborException("$additional isn't a valid CBOR Additional Type for the Simple Major Type.");
        }
    }
private static function decodeSimple ( $ additional , & $ bytes ) { switch ( $ additional ) { case AdditionalType :: SIMPLE_FALSE : return false ; case AdditionalType :: SIMPLE_TRUE : return true ; case AdditionalType :: SIMPLE_UNDEFINED : // Deliberate fall-through case AdditionalType :: SIMPLE_NULL : return null ; case AdditionalType :: FLOAT_16 : return self :: decodeDouble ( 2 , $ bytes ) ; case AdditionalType :: FLOAT_32 : return self :: decodeDouble ( 4 , $ bytes ) ; case AdditionalType :: FLOAT_64 : return self :: decodeDouble ( 8 , $ bytes ) ; default : throw new CborException ( "$additional isn't a valid CBOR Additional Type for the Simple Major Type." ) ; } }
Decodes a CBOR simple type, based on the first byte and additional data.

@param int $additional Addition type.
@param array $bytes Remaining bytes in string.
@throws CborException If the byte array is not long enough for the specified type of integer.
@return mixed Decoded simple type.
Decodes a CBOR simple type based on the first byte and additional data .