fix warning/error in php5.3

This commit is contained in:
William Cheng
2015-05-22 05:15:46 +08:00
parent 2b7bbd9513
commit fa15f58506
3 changed files with 18 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ class APIClient {
* @param string $host Base url of the API server (optional)
*/
function __construct($host = null) {
if ($host == null) {
if ($host === null) {
$this->host = '{{basePath}}';
} else {
$this->host = $host;
@@ -107,10 +107,12 @@ class APIClient {
* @return string API key with the prefix
*/
public function getApiKeyWithPrefix($apiKey) {
if (Configuration::$apiKeyPrefix[$apiKey]) {
if (isset(Configuration::$apiKeyPrefix[$apiKey])) {
return Configuration::$apiKeyPrefix[$apiKey]." ".Configuration::$apiKey[$apiKey];
} else {
} else if (isset(Configuration::$apiKey[$apiKey])) {
return Configuration::$apiKey[$apiKey];
} else {
return;
}
}
@@ -368,7 +370,7 @@ class APIClient {
$instance = new $class();
foreach ($instance::$swaggerTypes as $property => $type) {
$original_property_name = $instance::$attributeMap[$property];
if (isset($original_property_name)) {
if (isset($original_property_name) && isset($data->$original_property_name)) {
$instance->$property = self::deserialize($data->$original_property_name, $type);
}
}