private static function decideEncode($object, &$serialized)
    {
        switch ($type = gettype($object)) {
            case 'integer':
                $serialized .= "i{$object}e";
                break;

            case 'string':
                self::encodeString($object, $serialized);
                break;

            case 'array':
                $function = self::getArraySerializer($object);
                self::$function($object, $serialized);
                break;

            case 'boolean':
                $serialized .= $object === true ? 'i1e' : 'i0e';
                break;

            default:
                throw new EncodingException("Invalid type for encoding: $type", $object);
        }
    }
private static function decideEncode($object, &$serialized)
    {
        switch ($type = gettype($object)) {
            case 'integer':
                $serialized .= "i{$object}e";
                break;

            case 'string':
                self::encodeString($object, $serialized);
                break;

            case 'array':
                $function = self::getArraySerializer($object);
                self::$function($object, $serialized);
                break;

            case 'boolean':
                $serialized .= $object === true ? 'i1e' : 'i0e';
                break;

            default:
                throw new EncodingException("Invalid type for encoding: $type", $object);
        }
    }
private static function decideEncode ( $ object , & $ serialized ) { switch ( $ type = gettype ( $ object ) ) { case 'integer' : $ serialized .= "i{$object}e" ; break ; case 'string' : self :: encodeString ( $ object , $ serialized ) ; break ; case 'array' : $ function = self :: getArraySerializer ( $ object ) ; self :: $ function ( $ object , $ serialized ) ; break ; case 'boolean' : $ serialized .= $ object === true ? 'i1e' : 'i0e' ; break ; default : throw new EncodingException ( "Invalid type for encoding: $type" , $ object ) ; } }
Handles the serialization of one of the supported object types.

@param int|string|array|boolean $object Object to serialize.
@param string $serialized Reference to the serialization buffer.
Handles the serialization of one of the supported object types .