private static function encodeInteger($int)
    {
        // Unsigned ints have a unsigned int major type and need to be converted to abs($val) - 1
        if($int < 0)
        {
            $major = MajorType::NEGATIVE_INT;
            $int = abs($int) - 1;
        }
        else
        {
            $major = MajorType::POSITIVE_INT;
        }

        return self::encodeIntValue($major, $int);
    }
private static function encodeInteger($int)
    {
        // Unsigned ints have a unsigned int major type and need to be converted to abs($val) - 1
        if($int < 0)
        {
            $major = MajorType::NEGATIVE_INT;
            $int = abs($int) - 1;
        }
        else
        {
            $major = MajorType::POSITIVE_INT;
        }

        return self::encodeIntValue($major, $int);
    }
private static function encodeInteger ( $ int ) { // Unsigned ints have a unsigned int major type and need to be converted to abs($val) - 1 if ( $ int < 0 ) { $ major = MajorType :: NEGATIVE_INT ; $ int = abs ( $ int ) - 1 ; } else { $ major = MajorType :: POSITIVE_INT ; } return self :: encodeIntValue ( $ major , $ int ) ; }
Encodes an integer into a CBOR string.

@param int $int Int to encode.
@return string The encoded byte string.
Encodes an integer into a CBOR string .