diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index d276d1c652c..6fb9fb5dd06 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -39,7 +39,8 @@ class {{classname}} { function __construct($apiClient = null) { if ($apiClient == null) { - $apiClient = (new ApiClient())->setHost('{{basePath}}'); + $apiClient = new ApiClient(); + $apiClient->getConfig()->setHost('{{basePath}}'); } $this->apiClient = $apiClient;