Merge pull request #1990 from expectedbehavior/php-raw-string

[PHP] Use String instead of Byte Array
This commit is contained in:
wing328
2016-03-04 10:57:59 +08:00
8 changed files with 15 additions and 19 deletions

View File

@@ -230,7 +230,7 @@ class ApiClient
throw new ApiException("API call to $url timed out: ".serialize($response_info), 0, null, null);
} elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) {
// return raw body if response is a file
if ($responseType == '\SplFileObject' || $responseType == 'ByteArray') {
if ($responseType == '\SplFileObject' || $responseType == 'string') {
return array($http_body, $response_info['http_code'], $http_header);
}

View File

@@ -241,8 +241,6 @@ class ObjectSerializer
$values[] = self::deserialize($value, $subClass);
}
$deserialized = $values;
} elseif ($class === 'ByteArray') { // byte array
$deserialized = unpack('C*', (string)$data);
} elseif ($class === '\DateTime') {
$deserialized = new \DateTime($data);
} elseif (in_array($class, array({{&primitives}}))) {

View File

@@ -188,7 +188,7 @@ use \{{invokerPackage}}\ObjectSerializer;
{{#bodyParams}}// body params
$_tempBody = null;
if (isset(${{paramName}})) {
{{^isBinary}}$_tempBody = ${{paramName}};{{/isBinary}}{{#isBinary}}$_tempBody = call_user_func_array('pack', array_merge(array('C*'), ${{paramName}}));{{/isBinary}}
$_tempBody = ${{paramName}};
}{{/bodyParams}}
// for model (json/xml)