From 8e648e4d95b066f5f37ebaf36fda48453464c7ca Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Sat, 30 Jun 2018 20:30:25 +0900 Subject: [PATCH] [PHP] Remove unnecessary IF statement (#421) * Delete unused IF statement JSON_PRETTY_PRINT is available since PHP 5.4.0 * Update samples - bin/php-petstore.sh - bin/security/php-petstore.sh - bin/openapi3/php-petstore.sh --- .../src/main/resources/php/model_generic.mustache | 12 ++++-------- .../php/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../OpenAPIClient-php/lib/Model/ModelReturn.php | 14 +++++--------- .../php/OpenAPIClient-php/lib/ObjectSerializer.php | 4 ++-- .../lib/Model/AdditionalPropertiesClass.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Animal.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/AnimalFarm.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ApiResponse.php | 12 ++++-------- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 12 ++++-------- .../lib/Model/ArrayOfNumberOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/Capitalization.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Cat.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Category.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Client.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Dog.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 12 ++++-------- .../lib/Model/HasOnlyReadOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/MapTest.php | 12 ++++-------- ...MixedPropertiesAndAdditionalPropertiesClass.php | 12 ++++-------- .../lib/Model/Model200Response.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ModelReturn.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Name.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Order.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/OuterComposite.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Pet.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 12 ++++-------- .../lib/Model/SpecialModelName.php | 12 ++++-------- .../lib/Model/StringBooleanMap.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Tag.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/User.php | 12 ++++-------- .../lib/Model/AdditionalPropertiesClass.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Animal.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/AnimalFarm.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ApiResponse.php | 12 ++++-------- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 12 ++++-------- .../lib/Model/ArrayOfNumberOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ArrayTest.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/Capitalization.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Cat.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Category.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ClassModel.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Client.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Dog.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/EnumArrays.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/EnumTest.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/FormatTest.php | 12 ++++-------- .../lib/Model/HasOnlyReadOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/MapTest.php | 12 ++++-------- ...MixedPropertiesAndAdditionalPropertiesClass.php | 12 ++++-------- .../lib/Model/Model200Response.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/ModelList.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ModelReturn.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Name.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/NumberOnly.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Order.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/OuterComposite.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Pet.php | 12 ++++-------- .../OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 12 ++++-------- .../lib/Model/SpecialModelName.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/Tag.php | 12 ++++-------- .../php/OpenAPIClient-php/lib/Model/User.php | 12 ++++-------- 72 files changed, 269 insertions(+), 529 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/model_generic.mustache b/modules/openapi-generator/src/main/resources/php/model_generic.mustache index 80c0724bd81..57f557e75a0 100644 --- a/modules/openapi-generator/src/main/resources/php/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_generic.mustache @@ -406,13 +406,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore-security-test/php/.openapi-generator/VERSION b/samples/client/petstore-security-test/php/.openapi-generator/VERSION index 096bf47efe3..0628777500b 100644 --- a/samples/client/petstore-security-test/php/.openapi-generator/VERSION +++ b/samples/client/petstore-security-test/php/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php index e7c29a0121a..7032e80950c 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php index a6b5ca2843f..05fb9552d74 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php index 0c726cd301e..2d768effac8 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php index e3076bbfb42..1b89fb42845 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 25eec3465b6..67e8631bb2f 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php index a0405c42a78..25fcb651d0b 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** @@ -288,14 +288,10 @@ class ModelReturn implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php index fc15a8b6e0a..cf0e7a9de8e 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.0.0-SNAPSHOT + * OpenAPI Generator version: 3.1.0-SNAPSHOT */ /** @@ -223,7 +223,7 @@ class ObjectSerializer * @param string[] $httpHeaders HTTP headers * @param string $discriminator discriminator if polymorphism is used * - * @return object|array|null an single or an array of $class instances + * @return object|array|null a single or an array of $class instances */ public static function deserialize($data, $class, $httpHeaders = null) { diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 1456c315d07..4d63ff3244c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -317,14 +317,10 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ca0142fa51e..c34fcaf79e9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -324,14 +324,10 @@ class Animal implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index aadb757a918..106006e9a55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -262,14 +262,10 @@ class AnimalFarm implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 092712c11b9..7a78c52419a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -347,14 +347,10 @@ class ApiResponse implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 77aed6545d7..ebe474342de 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -287,14 +287,10 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index d9dc8aa0373..62ae10c4530 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -287,14 +287,10 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 6a8a60756d5..dd33c572c63 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -347,14 +347,10 @@ class ArrayTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index c9205e6baed..f9cdada7047 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -437,14 +437,10 @@ class Capitalization implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 52d5b899634..71480ba7c68 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -281,14 +281,10 @@ class Cat extends Animal */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 6dffead2b8e..96d06080987 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -317,14 +317,10 @@ class Category implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index a6bef51d463..7455b24a3d7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -288,14 +288,10 @@ class ClassModel implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index af02a8a0c09..c5036d640e9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -287,14 +287,10 @@ class Client implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index ad281540e6a..ebe735dc8f1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -281,14 +281,10 @@ class Dog extends Animal */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index d49b2effeec..fb81b7048e0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -373,14 +373,10 @@ class EnumArrays implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index aee7d38da54..0dfdca8408a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -542,14 +542,10 @@ class EnumTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 18451ace8c6..1615dc8c2d6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -772,14 +772,10 @@ class FormatTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 0aec1a15b1d..1f596373a75 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -317,14 +317,10 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 558bd7472d8..aec88ea2e7d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -401,14 +401,10 @@ class MapTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 2402bee97b0..1cc3b50b36a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -347,14 +347,10 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index e035873780c..d33fda9efb9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -318,14 +318,10 @@ class Model200Response implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index cd21b4dcaa8..94cf0089038 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -287,14 +287,10 @@ class ModelList implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 15abe91dec0..0b5ae81019e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -288,14 +288,10 @@ class ModelReturn implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 8df9358a58c..39b9fe019cb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -381,14 +381,10 @@ class Name implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index a5b9cd582bc..1eb56c9dafd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -287,14 +287,10 @@ class NumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 00d662c1b8f..44d147ef8c9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -471,14 +471,10 @@ class Order implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 3ed0c2cdb87..cb79fd1ac8b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -347,14 +347,10 @@ class OuterComposite implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index e6ca4db495e..11774ace3d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -477,14 +477,10 @@ class Pet implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 3175f692708..777e9efbb2c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -317,14 +317,10 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index d2ee354ef30..627c763bb67 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -287,14 +287,10 @@ class SpecialModelName implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php index e3daddaf25c..f24f12e02b0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php @@ -262,14 +262,10 @@ class StringBooleanMap implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 563a4ec39e5..4e22c830344 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -317,14 +317,10 @@ class Tag implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 1229ac6132b..9287956c6f6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -497,14 +497,10 @@ class User implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 1456c315d07..4d63ff3244c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -317,14 +317,10 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ca0142fa51e..c34fcaf79e9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -324,14 +324,10 @@ class Animal implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index aadb757a918..106006e9a55 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -262,14 +262,10 @@ class AnimalFarm implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 092712c11b9..7a78c52419a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -347,14 +347,10 @@ class ApiResponse implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 77aed6545d7..ebe474342de 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -287,14 +287,10 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index d9dc8aa0373..62ae10c4530 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -287,14 +287,10 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 6a8a60756d5..dd33c572c63 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -347,14 +347,10 @@ class ArrayTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index c9205e6baed..f9cdada7047 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -437,14 +437,10 @@ class Capitalization implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 52d5b899634..71480ba7c68 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -281,14 +281,10 @@ class Cat extends Animal */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 6dffead2b8e..96d06080987 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -317,14 +317,10 @@ class Category implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index a6bef51d463..7455b24a3d7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -288,14 +288,10 @@ class ClassModel implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index af02a8a0c09..c5036d640e9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -287,14 +287,10 @@ class Client implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index ad281540e6a..ebe735dc8f1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -281,14 +281,10 @@ class Dog extends Animal */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index d49b2effeec..fb81b7048e0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -373,14 +373,10 @@ class EnumArrays implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index aee7d38da54..0dfdca8408a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -542,14 +542,10 @@ class EnumTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 16be0e59f2b..1f0336e881b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -763,14 +763,10 @@ class FormatTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 0aec1a15b1d..1f596373a75 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -317,14 +317,10 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index 58763fc4770..63b493f9119 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -341,14 +341,10 @@ class MapTest implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 2402bee97b0..1cc3b50b36a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -347,14 +347,10 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index e035873780c..d33fda9efb9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -318,14 +318,10 @@ class Model200Response implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index cd21b4dcaa8..94cf0089038 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -287,14 +287,10 @@ class ModelList implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 15abe91dec0..0b5ae81019e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -288,14 +288,10 @@ class ModelReturn implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index e0aee2c4a55..aa33bf08a09 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -381,14 +381,10 @@ class Name implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index a5b9cd582bc..1eb56c9dafd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -287,14 +287,10 @@ class NumberOnly implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 00d662c1b8f..44d147ef8c9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -471,14 +471,10 @@ class Order implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 3ed0c2cdb87..cb79fd1ac8b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -347,14 +347,10 @@ class OuterComposite implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index e6ca4db495e..11774ace3d3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -477,14 +477,10 @@ class Pet implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 3175f692708..777e9efbb2c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -317,14 +317,10 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index f29188b0ccf..860925f3a71 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -287,14 +287,10 @@ class SpecialModelName implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 563a4ec39e5..4e22c830344 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -317,14 +317,10 @@ class Tag implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 1229ac6132b..9287956c6f6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -497,14 +497,10 @@ class User implements ModelInterface, ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); } }