Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ApiClient

// debugging for curl
if ($this->config->getDebug()) {
error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, $this->config->getDebugFile());
error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile());

curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a'));
Expand All @@ -231,7 +231,7 @@ class ApiClient

// debug HTTP response body
if ($this->config->getDebug()) {
error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, $this->config->getDebugFile());
error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile());
}

// Handle the response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class ObjectSerializer
$byte_written = $deserialized->fwrite($data);

if (Configuration::getDefaultConfiguration()->getDebug()) {
error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile());
error_log("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile());
}

return $deserialized;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ try {
{{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
print_r($result);{{/returnType}}
} catch (Exception $e) {
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), "\n";
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
}
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ try {
{{#returnType}}$result = {{/returnType}}$api_instance->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
print_r($result);{{/returnType}}
} catch (Exception $e) {
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), "\n";
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ class Configuration
*/
public static function toDebugReport()
{
$report = "PHP SDK ({{invokerPackage}}) Debug Report:\n";
$report .= " OS: ".php_uname()."\n";
$report .= " PHP Version: ".phpversion()."\n";
$report .= " OpenAPI Spec Version: {{version}}\n";
$report .= " SDK Package Version: {{artifactVersion}}\n";
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n";
$report = "PHP SDK ({{invokerPackage}}) Debug Report:".PHP_EOL;
$report .= " OS: ".php_uname().PHP_EOL;
$report .= " PHP Version: ".phpversion().PHP_EOL;
$report .= " OpenAPI Spec Version: {{version}}".PHP_EOL;
$report .= " SDK Package Version: {{artifactVersion}}".PHP_EOL;
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL;

return $report;
}
Expand Down
23 changes: 23 additions & 0 deletions samples/client/petstore/php/.swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
5 changes: 3 additions & 2 deletions samples/client/petstore/php/SwaggerClient-php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git

- API version: 1.0.0
- Package version:
- Build date: 2016-05-20T17:45:19.363+08:00
- Build date: 2016-05-24T14:56:49.287+02:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen

## Requirements
Expand Down Expand Up @@ -75,7 +75,7 @@ $password = "password_example"; // string | None
try {
$api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL;
}

?>
Expand Down Expand Up @@ -128,6 +128,7 @@ Class | Method | HTTP request | Description
- [Name](docs/Model/Name.md)
- [Order](docs/Model/Order.md)
- [Pet](docs/Model/Pet.md)
- [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md)
- [SpecialModelName](docs/Model/SpecialModelName.md)
- [Tag](docs/Model/Tag.md)
- [User](docs/Model/User.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $password = "password_example"; // string | None
try {
$api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password);
} catch (Exception $e) {
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n";
echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down
16 changes: 8 additions & 8 deletions samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje
try {
$api_instance->addPet($body);
} catch (Exception $e) {
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -83,7 +83,7 @@ $api_key = "api_key_example"; // string |
try {
$api_instance->deletePet($pet_id, $api_key);
} catch (Exception $e) {
echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -132,7 +132,7 @@ try {
$result = $api_instance->findPetsByStatus($status);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -180,7 +180,7 @@ try {
$result = $api_instance->findPetsByTags($tags);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -230,7 +230,7 @@ try {
$result = $api_instance->getPetById($pet_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -277,7 +277,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje
try {
$api_instance->updatePet($body);
} catch (Exception $e) {
echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -326,7 +326,7 @@ $status = "status_example"; // string | Updated status of the pet
try {
$api_instance->updatePetWithForm($pet_id, $name, $status);
} catch (Exception $e) {
echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -378,7 +378,7 @@ try {
$result = $api_instance->uploadFile($pet_id, $additional_metadata, $file);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n";
echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $order_id = "order_id_example"; // string | ID of the order that needs to be del
try {
$api_instance->deleteOrder($order_id);
} catch (Exception $e) {
echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n";
echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -77,7 +77,7 @@ try {
$result = $api_instance->getInventory();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), "\n";
echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -119,7 +119,7 @@ try {
$result = $api_instance->getOrderById($order_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), "\n";
echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -164,7 +164,7 @@ try {
$result = $api_instance->placeOrder($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), "\n";
echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Create
try {
$api_instance->createUser($body);
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -76,7 +76,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
try {
$api_instance->createUsersWithArrayInput($body);
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -120,7 +120,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object
try {
$api_instance->createUsersWithListInput($body);
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -164,7 +164,7 @@ $username = "username_example"; // string | The name that needs to be deleted
try {
$api_instance->deleteUser($username);
} catch (Exception $e) {
echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -209,7 +209,7 @@ try {
$result = $api_instance->getUserByName($username);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -255,7 +255,7 @@ try {
$result = $api_instance->loginUser($username, $password);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -299,7 +299,7 @@ $api_instance = new Swagger\Client\Api\UserApi();
try {
$api_instance->logoutUser();
} catch (Exception $e) {
echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down Expand Up @@ -341,7 +341,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Update
try {
$api_instance->updateUser($username, $body);
} catch (Exception $e) {
echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n";
echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
}
?>
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# AdditionalPropertiesClass

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MixedPropertiesAndAdditionalPropertiesClass

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **string** | | [optional]
**date_time** | [**\DateTime**](\DateTime.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ReadOnlyFirst

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **string** | | [optional]
**baz** | **string** | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header

// debugging for curl
if ($this->config->getDebug()) {
error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, $this->config->getDebugFile());
error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile());

curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a'));
Expand All @@ -231,7 +231,7 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header

// debug HTTP response body
if ($this->config->getDebug()) {
error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, $this->config->getDebugFile());
error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile());
}

// Handle the response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ public static function setDefaultConfiguration(Configuration $config)
*/
public static function toDebugReport()
{
$report = "PHP SDK (Swagger\Client) Debug Report:\n";
$report .= " OS: ".php_uname()."\n";
$report .= " PHP Version: ".phpversion()."\n";
$report .= " OpenAPI Spec Version: 1.0.0\n";
$report .= " SDK Package Version: \n";
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n";
$report = "PHP SDK (Swagger\Client) Debug Report:".PHP_EOL;
$report .= " OS: ".php_uname().PHP_EOL;
$report .= " PHP Version: ".phpversion().PHP_EOL;
$report .= " OpenAPI Spec Version: 1.0.0".PHP_EOL;
$report .= " SDK Package Version: ".PHP_EOL;
$report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL;

return $report;
}
Expand Down
Loading