From b7638f4498d4ea5a8fb9a9e4bb641898d41b7454 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Mon, 19 Oct 2026 14:51:16 +0200 Subject: [PATCH 1/6] fix(php): PHP client now requires PHP 8.3+ and Guzzle 8 Generated composer.json depended on guzzlehttp/guzzle ^6.2 and squizlabs/php_codesniffer ~2.6. Both are EOL and every release in range is blocked by Composer security advisories, which fails the PHP build. Note for users regenerating a PHP client: the generated code now requires PHP >=8.3, guzzlehttp/guzzle ^8.3 and phpcs ^3.0 (php-symfony: phpcs ^3.0 only). The codegen CLI and its options are unchanged. api.mustache: - Psr7\try_fopen -> Psr7\Utils::tryFopen - \GuzzleHttp\json_encode -> native json_encode(..., JSON_THROW_ON_ERROR) (Guzzle 8 removed it; a failure now throws \JsonException) - implicit nullable constructor params -> ?Type README/.travis.yml: PHP 8.3. Co-Authored-By: Claude Sonnet 5.5 --- .../main/resources/php-symfony/composer.mustache | 2 +- .../src/main/resources/php/.travis.yml | 6 +----- .../src/main/resources/php/README.mustache | 4 ++-- .../src/main/resources/php/api.mustache | 14 +++++++------- .../src/main/resources/php/composer.mustache | 6 +++--- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache index 5d6156df550..b9ef879091a 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/composer.mustache @@ -30,7 +30,7 @@ "require-dev": { "phpunit/phpunit": "~4.8", "satooshi/php-coveralls": "~1.0", - "squizlabs/php_codesniffer": "~2.6", + "squizlabs/php_codesniffer": "^3.0", "friendsofphp/php-cs-fixer": "~1.12", "symfony/browser-kit": "*", "hoa/regex": "~1.0" diff --git a/modules/swagger-codegen/src/main/resources/php/.travis.yml b/modules/swagger-codegen/src/main/resources/php/.travis.yml index d77f3825f6f..989be894218 100644 --- a/modules/swagger-codegen/src/main/resources/php/.travis.yml +++ b/modules/swagger-codegen/src/main/resources/php/.travis.yml @@ -1,10 +1,6 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 8.3 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache index 18bb80f7ce0..fea61dadffe 100644 --- a/modules/swagger-codegen/src/main/resources/php/README.mustache +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -19,7 +19,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements -PHP 5.5 and later +PHP 8.3 and later ## Installation & Usage ### Composer @@ -59,7 +59,7 @@ composer install ./vendor/bin/phpunit ``` -**Note:** Running tests requires PHP 7.2 or later, while the runtime library supports PHP 5.5 and later. +**Note:** Running tests requires PHP 8.3 or later. ## Getting Started diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index e0b01e1f678..ab2df5255ce 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -60,9 +60,9 @@ use {{invokerPackage}}\ObjectSerializer; * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -396,7 +396,7 @@ use {{invokerPackage}}\ObjectSerializer; if (${{paramName}} !== null) { {{#isFile}} $multipart = true; - $formParams['{{baseName}}'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue(${{paramName}}), 'rb'); + $formParams['{{baseName}}'] = \GuzzleHttp\Psr7\Utils::tryFopen(ObjectSerializer::toFormValue(${{paramName}}), 'rb'); {{/isFile}} {{^isFile}} $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); @@ -430,11 +430,11 @@ use {{invokerPackage}}\ObjectSerializer; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -450,7 +450,7 @@ use {{invokerPackage}}\ObjectSerializer; $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index 6f745a2c80d..90612fac727 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -19,15 +19,15 @@ } ], "require": { - "php": ">=5.5", + "php": ">=8.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^8.3" }, "require-dev": { "phpunit/phpunit": "^8.5.52", - "squizlabs/php_codesniffer": "~2.6", + "squizlabs/php_codesniffer": "^3.0", "friendsofphp/php-cs-fixer": "~2.12" }, "autoload": { From fc19d6488ad266c3f56b09571ed9c89947b9affc Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Mon, 19 Oct 2026 14:51:17 +0200 Subject: [PATCH 2/6] chore(php): regenerate PHP samples and bump PHP version in CI to 8.3 - regenerate samples/client/petstore/php, petstore-security-test/php and samples/server/petstore/php-symfony with the updated templates - port hand-written sample tests to PHPUnit\Framework\TestCase, typed setUp()/setUpBeforeClass() and expectException(); make FakeHttpClient compatible with the Guzzle 8 ClientInterface - run PHP workflows on PHP 8.3 (was 7.4) Ints/Numbers models are intentionally not added: they do not compile on PHP 8 (pre-existing generator issue, same on master). Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/test-framework-php.yml | 2 +- .github/workflows/test-framework-v2-php.yml | 2 +- .github/workflows/test-framework-v3-php.yml | 2 +- .github/workflows/test-generation-v2.yml | 2 +- .../php/.swagger-codegen/VERSION | 2 +- .../php/SwaggerClient-php/.php_cs | 33 ++-- .../php/SwaggerClient-php/.travis.yml | 6 +- .../php/SwaggerClient-php/README.md | 4 +- .../php/SwaggerClient-php/composer.json | 10 +- .../php/SwaggerClient-php/git_push.sh | 14 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 23 ++- .../SwaggerClient-php/lib/ApiException.php | 2 +- .../SwaggerClient-php/lib/Configuration.php | 2 +- .../SwaggerClient-php/lib/HeaderSelector.php | 3 +- .../lib/Model/ModelInterface.php | 2 +- .../lib/Model/ModelReturn.php | 6 +- .../lib/ObjectSerializer.php | 11 +- .../test/Api/FakeApiTest.php | 12 +- .../test/Model/ModelReturnTest.php | 12 +- .../petstore/php/.swagger-codegen/VERSION | 2 +- .../php/SwaggerClient-php/.travis.yml | 6 +- .../petstore/php/SwaggerClient-php/README.md | 80 +++++++-- .../php/SwaggerClient-php/composer.json | 8 +- .../php/SwaggerClient-php/docs/Api/PetApi.md | 2 +- .../SwaggerClient-php/docs/Api/StoreApi.md | 6 +- .../php/SwaggerClient-php/docs/Api/UserApi.md | 2 +- .../SwaggerClient-php/docs/Model/Boolean.md | 9 + .../php/SwaggerClient-php/git_push.sh | 14 +- .../lib/Api/AnotherFakeApi.php | 23 ++- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 162 +++++++++++++----- .../lib/Api/FakeClassnameTags123Api.php | 23 ++- .../php/SwaggerClient-php/lib/Api/PetApi.php | 60 +++---- .../SwaggerClient-php/lib/Api/StoreApi.php | 42 ++--- .../php/SwaggerClient-php/lib/Api/UserApi.php | 58 +++---- .../SwaggerClient-php/lib/ApiException.php | 4 +- .../SwaggerClient-php/lib/Configuration.php | 6 +- .../SwaggerClient-php/lib/HeaderSelector.php | 4 +- .../lib/Model/AdditionalPropertiesClass.php | 6 +- .../SwaggerClient-php/lib/Model/Animal.php | 6 +- .../lib/Model/AnimalFarm.php | 6 +- .../lib/Model/ApiResponse.php | 9 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 6 +- .../lib/Model/ArrayOfNumberOnly.php | 6 +- .../SwaggerClient-php/lib/Model/ArrayTest.php | 6 +- .../SwaggerClient-php/lib/Model/Boolean.php | 63 +++++++ .../lib/Model/Capitalization.php | 6 +- .../php/SwaggerClient-php/lib/Model/Cat.php | 6 +- .../SwaggerClient-php/lib/Model/Category.php | 9 +- .../lib/Model/ClassModel.php | 6 +- .../SwaggerClient-php/lib/Model/Client.php | 6 +- .../php/SwaggerClient-php/lib/Model/Dog.php | 6 +- .../lib/Model/EnumArrays.php | 6 +- .../SwaggerClient-php/lib/Model/EnumClass.php | 2 +- .../SwaggerClient-php/lib/Model/EnumTest.php | 6 +- .../lib/Model/FormatTest.php | 6 +- .../lib/Model/HasOnlyReadOnly.php | 6 +- .../SwaggerClient-php/lib/Model/MapTest.php | 6 +- ...PropertiesAndAdditionalPropertiesClass.php | 6 +- .../lib/Model/Model200Response.php | 6 +- .../lib/Model/ModelInterface.php | 4 +- .../SwaggerClient-php/lib/Model/ModelList.php | 6 +- .../lib/Model/ModelReturn.php | 6 +- .../php/SwaggerClient-php/lib/Model/Name.php | 6 +- .../lib/Model/NumberOnly.php | 6 +- .../php/SwaggerClient-php/lib/Model/Order.php | 9 +- .../lib/Model/OuterBoolean.php | 6 +- .../lib/Model/OuterComposite.php | 6 +- .../SwaggerClient-php/lib/Model/OuterEnum.php | 2 +- .../lib/Model/OuterNumber.php | 6 +- .../lib/Model/OuterString.php | 6 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 9 +- .../lib/Model/ReadOnlyFirst.php | 6 +- .../lib/Model/SpecialModelName.php | 6 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 9 +- .../php/SwaggerClient-php/lib/Model/User.php | 9 +- .../lib/ObjectSerializer.php | 4 +- .../php/SwaggerClient-php/phpunit.xml.dist | 4 +- .../test/Api/AnotherFakeApiTest.php | 12 +- .../test/Api/FakeApiTest.php | 12 +- .../test/Api/FakeClassnameTags123ApiTest.php | 12 +- .../SwaggerClient-php/test/Api/PetApiTest.php | 12 +- .../test/Api/StoreApiTest.php | 12 +- .../test/Api/UserApiTest.php | 12 +- .../Model/AdditionalPropertiesClassTest.php | 12 +- .../test/Model/AnimalFarmTest.php | 12 +- .../test/Model/AnimalTest.php | 12 +- .../test/Model/ApiResponseTest.php | 12 +- .../Model/ArrayOfArrayOfNumberOnlyTest.php | 12 +- .../test/Model/ArrayOfNumberOnlyTest.php | 12 +- .../test/Model/ArrayTestTest.php | 12 +- .../test/Model/BooleanTest.php | 78 +++++++++ .../test/Model/CapitalizationTest.php | 12 +- .../SwaggerClient-php/test/Model/CatTest.php | 12 +- .../test/Model/CategoryTest.php | 12 +- .../test/Model/ClassModelTest.php | 12 +- .../test/Model/ClientTest.php | 12 +- .../SwaggerClient-php/test/Model/DogTest.php | 12 +- .../test/Model/EnumArraysTest.php | 12 +- .../test/Model/EnumClassTest.php | 12 +- .../test/Model/EnumTestTest.php | 12 +- .../test/Model/FormatTestTest.php | 12 +- .../test/Model/HasOnlyReadOnlyTest.php | 12 +- .../test/Model/MapTestTest.php | 12 +- ...ertiesAndAdditionalPropertiesClassTest.php | 12 +- .../test/Model/Model200ResponseTest.php | 12 +- .../test/Model/ModelListTest.php | 12 +- .../test/Model/ModelReturnTest.php | 12 +- .../SwaggerClient-php/test/Model/NameTest.php | 12 +- .../test/Model/NumberOnlyTest.php | 12 +- .../test/Model/OrderTest.php | 12 +- .../test/Model/OuterBooleanTest.php | 12 +- .../test/Model/OuterCompositeTest.php | 12 +- .../test/Model/OuterEnumTest.php | 12 +- .../test/Model/OuterNumberTest.php | 12 +- .../test/Model/OuterStringTest.php | 12 +- .../SwaggerClient-php/test/Model/PetTest.php | 12 +- .../test/Model/ReadOnlyFirstTest.php | 12 +- .../test/Model/SpecialModelNameTest.php | 12 +- .../SwaggerClient-php/test/Model/TagTest.php | 12 +- .../SwaggerClient-php/test/Model/UserTest.php | 12 +- .../php/SwaggerClient-php/tests/AsyncTest.php | 8 +- .../php/SwaggerClient-php/tests/AuthTest.php | 2 +- .../tests/DateTimeSerializerTest.php | 2 +- .../php/SwaggerClient-php/tests/DebugTest.php | 2 +- .../SwaggerClient-php/tests/EnumClassTest.php | 2 +- .../SwaggerClient-php/tests/EnumTestTest.php | 2 +- .../SwaggerClient-php/tests/ExceptionTest.php | 2 +- .../tests/FakeHttpClient.php | 11 +- .../tests/FormatTestTest.php | 2 +- .../tests/HeaderSelectorTest.php | 2 +- .../SwaggerClient-php/tests/HeadersTest.php | 4 +- .../tests/ModelInheritanceTest.php | 2 +- .../tests/ObjectSerializerTest.php | 2 +- .../SwaggerClient-php/tests/OrderApiTest.php | 4 +- .../SwaggerClient-php/tests/OuterEnumTest.php | 6 +- .../tests/ParametersTest.php | 4 +- .../SwaggerClient-php/tests/PetApiTest.php | 8 +- .../php/SwaggerClient-php/tests/PetTest.php | 2 +- .../SwaggerClient-php/tests/RequestTest.php | 4 +- .../tests/ResponseTypesTest.php | 4 +- .../SwaggerClient-php/tests/StoreApiTest.php | 6 +- .../SwaggerClient-php/tests/UserApiTest.php | 4 +- .../php-symfony/.swagger-codegen/VERSION | 2 +- .../SymfonyBundle-php/composer.json | 2 +- 144 files changed, 1040 insertions(+), 593 deletions(-) create mode 100644 samples/client/petstore/php/SwaggerClient-php/docs/Model/Boolean.md create mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Model/Boolean.php create mode 100644 samples/client/petstore/php/SwaggerClient-php/test/Model/BooleanTest.php diff --git a/.github/workflows/test-framework-php.yml b/.github/workflows/test-framework-php.yml index 0b5e4b32745..e3dfebda70f 100644 --- a/.github/workflows/test-framework-php.yml +++ b/.github/workflows/test-framework-php.yml @@ -160,7 +160,7 @@ jobs: - name: Setup PHP with composer v2 uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' tools: composer:v2 ############################################### ##### END DYNAMIC: Dependent on build environment diff --git a/.github/workflows/test-framework-v2-php.yml b/.github/workflows/test-framework-v2-php.yml index af6a0e7083d..7c7e69da723 100644 --- a/.github/workflows/test-framework-v2-php.yml +++ b/.github/workflows/test-framework-v2-php.yml @@ -143,7 +143,7 @@ jobs: - name: Setup PHP with composer v2 uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' tools: composer:v2 ############################################### ##### END DYNAMIC: Dependent on build environment diff --git a/.github/workflows/test-framework-v3-php.yml b/.github/workflows/test-framework-v3-php.yml index ae871aba9cb..3954674e242 100644 --- a/.github/workflows/test-framework-v3-php.yml +++ b/.github/workflows/test-framework-v3-php.yml @@ -145,7 +145,7 @@ jobs: - name: Setup PHP with composer v2 uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' tools: composer:v2 ############################################### ##### END DYNAMIC: Dependent on build environment diff --git a/.github/workflows/test-generation-v2.yml b/.github/workflows/test-generation-v2.yml index 0185a2159c4..4825397a804 100644 --- a/.github/workflows/test-generation-v2.yml +++ b/.github/workflows/test-generation-v2.yml @@ -410,7 +410,7 @@ jobs: - name: Setup PHP with composer v2 uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.3' tools: composer:v2 ############################################### ##### END DYNAMIC: Dependent on build environment diff --git a/samples/client/petstore-security-test/php/.swagger-codegen/VERSION b/samples/client/petstore-security-test/php/.swagger-codegen/VERSION index 855ff9501eb..bab531eaf33 100644 --- a/samples/client/petstore-security-test/php/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/php/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +2.4.53-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs b/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs index 6b8e23c818a..4fbe53ec5ff 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs @@ -1,18 +1,23 @@ level(Symfony\CS\FixerInterface::PSR2_LEVEL) +return PhpCsFixer\Config::create() ->setUsingCache(true) - ->fixers( - [ - 'ordered_use', - 'phpdoc_order', - 'short_array_syntax', - 'strict', - 'strict_param' - ] - ) - ->finder( - Symfony\CS\Finder\DefaultFinder::create() - ->in(__DIR__) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) ); diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/.travis.yml b/samples/client/petstore-security-test/php/SwaggerClient-php/.travis.yml index d77f3825f6f..989be894218 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/.travis.yml +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/.travis.yml @@ -1,10 +1,6 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 8.3 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/README.md b/samples/client/petstore-security-test/php/SwaggerClient-php/README.md index 1f5c98d4da7..5c4b94e7d37 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/README.md +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/README.md @@ -8,7 +8,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git ## Requirements -PHP 5.5 and later +PHP 8.3 and later ## Installation & Usage ### Composer @@ -48,6 +48,8 @@ composer install ./vendor/bin/phpunit ``` +**Note:** Running tests requires PHP 8.3 or later. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json index 2ebbe805eea..3fba36ac1de 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json @@ -16,16 +16,16 @@ } ], "require": { - "php": ">=5.5", + "php": ">=8.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" + "phpunit/phpunit": "^8.5.52", + "squizlabs/php_codesniffer": "^3.0", + "friendsofphp/php-cs-fixer": "~2.12" }, "autoload": { "psr-4": { "Swagger\\Client\\" : "lib/" } diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/git_push.sh b/samples/client/petstore-security-test/php/SwaggerClient-php/git_push.sh index 160f6f21399..ea15627ab9f 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/git_push.sh +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/git_push.sh @@ -6,6 +6,7 @@ git_user_id=$1 git_repo_id=$2 release_note=$3 +git_repo_base_url=$4 if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -22,6 +23,11 @@ if [ "$release_note" = "" ]; then echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi +if [ "$git_repo_base_url" = "" ]; then + git_repo_base_url="https://github.com" + echo "[INFO] No command line input provided. Set \$git_repo_base_url to $git_repo_base_url" +fi + # Initialize the local directory as a Git repository git init @@ -37,9 +43,11 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git_repo_base_url=${git_repo_base_url#*//} + git_repo_base_url=${git_repo_base_url%%.*} + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +55,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index 5f2eb0eff73..840e4ebc657 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class FakeApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -256,9 +256,16 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -273,7 +280,7 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 9ed326a3c6f..df4ede95c14 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php index 192e8b2c6c7..7977daf0e1a 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php index 676173de468..a19fc4e2eeb 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -107,4 +107,3 @@ private function selectContentTypeHeader($contentType) } } } - diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php index 6013c8cf977..2232a898a2e 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php index 4d820c4cc87..ec1e50639ca 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -235,6 +235,7 @@ public function setReturn($return) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -247,6 +248,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -260,6 +262,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -276,6 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php index 720eb97a8e5..85d32a9d239 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -59,6 +59,11 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $data[$property] = self::sanitizeForSerialization($value); } return $data; + } elseif ($data instanceof \stdClass) { + foreach ($data as $property => $value) { + $data->$property = self::sanitizeForSerialization($value); + } + return $data; } elseif (is_object($data)) { $values = []; $formats = $data::swaggerFormats(); @@ -68,7 +73,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n if ($value !== null && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues())) { + && !in_array($value, $swaggerType::getAllowableEnumValues(), true)) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); } @@ -284,7 +289,7 @@ public static function deserialize($data, $class, $httpHeaders = null) return new \SplFileObject($filename, 'r'); } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/test/Api/FakeApiTest.php b/samples/client/petstore-security-test/php/SwaggerClient-php/test/Api/FakeApiTest.php index 613e83d2089..f51f3f469b6 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class FakeApiTest extends \PHPUnit_Framework_TestCase +class FakeApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore-security-test/php/SwaggerClient-php/test/Model/ModelReturnTest.php index b49dc30a4e0..8543abdcf08 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.0-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class ModelReturnTest extends \PHPUnit_Framework_TestCase +class ModelReturnTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/.swagger-codegen/VERSION b/samples/client/petstore/php/.swagger-codegen/VERSION index 017674fb59d..bab531eaf33 100644 --- a/samples/client/petstore/php/.swagger-codegen/VERSION +++ b/samples/client/petstore/php/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.53-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/SwaggerClient-php/.travis.yml b/samples/client/petstore/php/SwaggerClient-php/.travis.yml index d77f3825f6f..989be894218 100644 --- a/samples/client/petstore/php/SwaggerClient-php/.travis.yml +++ b/samples/client/petstore/php/SwaggerClient-php/.travis.yml @@ -1,10 +1,6 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 8.3 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index feba5d37b72..1267a0ff3ef 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -1,5 +1,5 @@ # SwaggerClient-php -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: @@ -8,7 +8,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git ## Requirements -PHP 5.5 and later +PHP 8.3 and later ## Installation & Usage ### Composer @@ -48,6 +48,8 @@ composer install ./vendor/bin/phpunit ``` +**Note:** Running tests requires PHP 8.3 or later. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: @@ -56,21 +58,18 @@ Please follow the [installation procedure](#installation--usage) and then run th setAccessToken('YOUR_ACCESS_TOKEN'); - -$apiInstance = new Swagger\Client\Api\PetApi( +$apiInstance = new Swagger\Client\Api\AnotherFakeApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); -$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store +$body = new \Swagger\Client\Model\Client(); // \Swagger\Client\Model\Client | client model try { - $apiInstance->addPet($body); + $result = $apiInstance->testSpecialTags($body); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -78,10 +77,22 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/Api/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/Api/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/Api/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -90,9 +101,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/Api/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/Api/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/Api/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/Api/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/Api/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/Api/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/Api/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/Api/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/Api/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -106,10 +117,41 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md) + - [Animal](docs/Model/Animal.md) + - [AnimalFarm](docs/Model/AnimalFarm.md) - [ApiResponse](docs/Model/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) + - [ArrayTest](docs/Model/ArrayTest.md) + - [Boolean](docs/Model/Boolean.md) + - [Capitalization](docs/Model/Capitalization.md) + - [Cat](docs/Model/Cat.md) - [Category](docs/Model/Category.md) + - [ClassModel](docs/Model/ClassModel.md) + - [Client](docs/Model/Client.md) + - [Dog](docs/Model/Dog.md) + - [EnumArrays](docs/Model/EnumArrays.md) + - [EnumClass](docs/Model/EnumClass.md) + - [EnumTest](docs/Model/EnumTest.md) + - [FormatTest](docs/Model/FormatTest.md) + - [HasOnlyReadOnly](docs/Model/HasOnlyReadOnly.md) + - [MapTest](docs/Model/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model/Model200Response.md) + - [ModelList](docs/Model/ModelList.md) + - [ModelReturn](docs/Model/ModelReturn.md) + - [Name](docs/Model/Name.md) + - [NumberOnly](docs/Model/NumberOnly.md) - [Order](docs/Model/Order.md) + - [OuterBoolean](docs/Model/OuterBoolean.md) + - [OuterComposite](docs/Model/OuterComposite.md) + - [OuterEnum](docs/Model/OuterEnum.md) + - [OuterNumber](docs/Model/OuterNumber.md) + - [OuterString](docs/Model/OuterString.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) @@ -123,6 +165,16 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/php/SwaggerClient-php/composer.json b/samples/client/petstore/php/SwaggerClient-php/composer.json index 2d76f02819b..3fba36ac1de 100644 --- a/samples/client/petstore/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore/php/SwaggerClient-php/composer.json @@ -16,15 +16,15 @@ } ], "require": { - "php": ">=5.5", + "php": ">=8.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6", + "phpunit/phpunit": "^8.5.52", + "squizlabs/php_codesniffer": "^3.0", "friendsofphp/php-cs-fixer": "~2.12" }, "autoload": { diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md index 6a1773d4b28..46e42007fac 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md @@ -1,6 +1,6 @@ # Swagger\Client\PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 649dcc4b265..87cec61aa7b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -1,12 +1,12 @@ # Swagger\Client\StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md index 7953ca871f6..52b0a351904 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md @@ -1,6 +1,6 @@ # Swagger\Client\UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/Boolean.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/Boolean.md new file mode 100644 index 00000000000..d0b536f8086 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/Boolean.md @@ -0,0 +1,9 @@ +# Boolean + +## 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) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/git_push.sh b/samples/client/petstore/php/SwaggerClient-php/git_push.sh index 160f6f21399..ea15627ab9f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/git_push.sh +++ b/samples/client/petstore/php/SwaggerClient-php/git_push.sh @@ -6,6 +6,7 @@ git_user_id=$1 git_repo_id=$2 release_note=$3 +git_repo_base_url=$4 if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -22,6 +23,11 @@ if [ "$release_note" = "" ]; then echo "[INFO] No command line input provided. Set \$release_note to $release_note" fi +if [ "$git_repo_base_url" = "" ]; then + git_repo_base_url="https://github.com" + echo "[INFO] No command line input provided. Set \$git_repo_base_url to $git_repo_base_url" +fi + # Initialize the local directory as a Git repository git init @@ -37,9 +43,11 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin ${git_repo_base_url}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git_repo_base_url=${git_repo_base_url#*//} + git_repo_base_url=${git_repo_base_url%%.*} + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +55,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index c54892b41b3..400df721516 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class AnotherFakeApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -298,9 +298,16 @@ protected function testSpecialTagsRequest($body) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -315,7 +322,7 @@ protected function testSpecialTagsRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index db1172f6ccc..a0fcbaebf08 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class FakeApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -288,9 +288,16 @@ protected function fakeOuterBooleanSerializeRequest($body = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -305,7 +312,7 @@ protected function fakeOuterBooleanSerializeRequest($body = null) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -535,9 +542,16 @@ protected function fakeOuterCompositeSerializeRequest($body = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -552,7 +566,7 @@ protected function fakeOuterCompositeSerializeRequest($body = null) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -782,9 +796,16 @@ protected function fakeOuterNumberSerializeRequest($body = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -799,7 +820,7 @@ protected function fakeOuterNumberSerializeRequest($body = null) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1029,9 +1050,16 @@ protected function fakeOuterStringSerializeRequest($body = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1046,7 +1074,7 @@ protected function fakeOuterStringSerializeRequest($body = null) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1260,9 +1288,16 @@ protected function testBodyWithQueryParamsRequest($body, $query) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1277,7 +1312,7 @@ protected function testBodyWithQueryParamsRequest($body, $query) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1517,9 +1552,16 @@ protected function testClientModelRequest($body) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1534,7 +1576,7 @@ protected function testClientModelRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1920,9 +1962,16 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1937,7 +1986,7 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -2152,8 +2201,8 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en // query params if (is_array($enum_query_string_array)) { - $enum_query_string_array = ObjectSerializer::serializeCollection($enum_query_string_array, 'csv', true); - } + $queryParams['enum_query_string_array'] = $enum_query_string_array; + } else if ($enum_query_string_array !== null) { $queryParams['enum_query_string_array'] = ObjectSerializer::toQueryValue($enum_query_string_array); } @@ -2208,9 +2257,16 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2225,7 +2281,7 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -2428,9 +2484,16 @@ protected function testInlineAdditionalPropertiesRequest($param) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2445,7 +2508,7 @@ protected function testInlineAdditionalPropertiesRequest($param) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -2664,9 +2727,16 @@ protected function testJsonFormDataRequest($param, $param2) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2681,7 +2751,7 @@ protected function testJsonFormDataRequest($param, $param2) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index 2b9ce933a6f..99bde82fb42 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class FakeClassnameTags123Api * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -298,9 +298,16 @@ protected function testClassnameRequest($body) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + if($headers['Content-Type'] === 'application/json') { + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass) { + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); + } + // array has no __toString(), so we should encode it manually + if(is_array($httpBody)) { + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); + } } } elseif (count($formParams) > 0) { if ($multipart) { @@ -315,7 +322,7 @@ protected function testClassnameRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 85df4c18fa1..e478aee3772 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class PetApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -265,11 +265,11 @@ protected function addPetRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -285,7 +285,7 @@ protected function addPetRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -510,11 +510,11 @@ protected function deletePetRequest($pet_id, $api_key = null) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -530,7 +530,7 @@ protected function deletePetRequest($pet_id, $api_key = null) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -782,11 +782,11 @@ protected function findPetsByStatusRequest($status) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -802,7 +802,7 @@ protected function findPetsByStatusRequest($status) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1054,11 +1054,11 @@ protected function findPetsByTagsRequest($tags) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1074,7 +1074,7 @@ protected function findPetsByTagsRequest($tags) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1327,11 +1327,11 @@ protected function getPetByIdRequest($pet_id) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1347,7 +1347,7 @@ protected function getPetByIdRequest($pet_id) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1559,11 +1559,11 @@ protected function updatePetRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1579,7 +1579,7 @@ protected function updatePetRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1813,11 +1813,11 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1833,7 +1833,7 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -2081,7 +2081,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // form params if ($file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); + $formParams['file'] = \GuzzleHttp\Psr7\Utils::tryFopen(ObjectSerializer::toFormValue($file), 'rb'); } // body params $_tempBody = null; @@ -2105,11 +2105,11 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -2125,7 +2125,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index a65dd45a52c..a7a5289d6c8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class StoreApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -231,7 +231,7 @@ protected function deleteOrderRequest($order_id) ); } - $resourcePath = '/store/order/{orderId}'; + $resourcePath = '/store/order/{order_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -242,7 +242,7 @@ protected function deleteOrderRequest($order_id) // path params if ($order_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', + '{' . 'order_id' . '}', ObjectSerializer::toPathValue($order_id), $resourcePath ); @@ -270,11 +270,11 @@ protected function deleteOrderRequest($order_id) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -290,7 +290,7 @@ protected function deleteOrderRequest($order_id) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -520,11 +520,11 @@ protected function getInventoryRequest() if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -540,7 +540,7 @@ protected function getInventoryRequest() $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -762,7 +762,7 @@ protected function getOrderByIdRequest($order_id) } - $resourcePath = '/store/order/{orderId}'; + $resourcePath = '/store/order/{order_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -773,7 +773,7 @@ protected function getOrderByIdRequest($order_id) // path params if ($order_id !== null) { $resourcePath = str_replace( - '{' . 'orderId' . '}', + '{' . 'order_id' . '}', ObjectSerializer::toPathValue($order_id), $resourcePath ); @@ -801,11 +801,11 @@ protected function getOrderByIdRequest($order_id) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -821,7 +821,7 @@ protected function getOrderByIdRequest($order_id) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1065,11 +1065,11 @@ protected function placeOrderRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1085,7 +1085,7 @@ protected function placeOrderRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index edf55946bae..17206c2328e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -70,9 +70,9 @@ class UserApi * @param HeaderSelector $selector */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); @@ -265,11 +265,11 @@ protected function createUserRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -285,7 +285,7 @@ protected function createUserRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -492,11 +492,11 @@ protected function createUsersWithArrayInputRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -512,7 +512,7 @@ protected function createUsersWithArrayInputRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -719,11 +719,11 @@ protected function createUsersWithListInputRequest($body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -739,7 +739,7 @@ protected function createUsersWithListInputRequest($body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -951,11 +951,11 @@ protected function deleteUserRequest($username) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -971,7 +971,7 @@ protected function deleteUserRequest($username) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1220,11 +1220,11 @@ protected function getUserByNameRequest($username) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1240,7 +1240,7 @@ protected function getUserByNameRequest($username) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1500,11 +1500,11 @@ protected function loginUserRequest($username, $password) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1520,7 +1520,7 @@ protected function loginUserRequest($username, $password) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1713,11 +1713,11 @@ protected function logoutUserRequest() if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1733,7 +1733,7 @@ protected function logoutUserRequest() $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) @@ -1959,11 +1959,11 @@ protected function updateUserRequest($username, $body) if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + $httpBody = json_encode($httpBody, JSON_THROW_ON_ERROR); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody), JSON_THROW_ON_ERROR); } } } elseif (count($formParams) > 0) { @@ -1979,7 +1979,7 @@ protected function updateUserRequest($username, $body) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR); } else { // for HTTP post (form) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 38d93510c96..0815abef667 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index fb610939c5b..420e702d114 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -81,7 +81,7 @@ class Configuration * * @var string */ - protected $host = 'http://petstore.swagger.io/v2'; + protected $host = 'http://petstore.swagger.io:80/v2'; /** * User agent of the HTTP request, set to "PHP-Swagger" by default diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php index 00235d1a77a..3d5b235048e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/HeaderSelector.php @@ -12,12 +12,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php index 74369007f91..4b28d446a78 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -264,6 +264,7 @@ public function setMapOfMapProperty($map_of_map_property) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -276,6 +277,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -289,6 +291,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -305,6 +308,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 706f7d82600..156732f0525 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -271,6 +271,7 @@ public function setColor($color) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -283,6 +284,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -296,6 +298,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -312,6 +315,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index c0bffb19198..2bcc1788c19 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -209,6 +209,7 @@ public function valid() * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -221,6 +222,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -234,6 +236,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -250,6 +253,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index e4439f756b1..c26a1598aa7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * ApiResponse Class Doc Comment * * @category Class - * @description Describes the result of uploading an image resource * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -295,6 +294,7 @@ public function setMessage($message) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -307,6 +307,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -320,6 +321,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -336,6 +338,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index a9d2f531649..72009f51b6d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function setArrayArrayNumber($array_array_number) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php index c5b73d07dfc..0d88fdf0903 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function setArrayNumber($array_number) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php index 9a7efa27283..74ee96b7a78 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -294,6 +294,7 @@ public function setArrayArrayOfModel($array_array_of_model) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -306,6 +307,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -319,6 +321,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -335,6 +338,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Boolean.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Boolean.php new file mode 100644 index 00000000000..17ad7c90fbc --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Boolean.php @@ -0,0 +1,63 @@ +container[$offset]); @@ -396,6 +397,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -409,6 +411,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -425,6 +428,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 6029e0ffd55..71d8589c83f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -228,6 +228,7 @@ public function setDeclawed($declawed) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -240,6 +241,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -253,6 +255,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -269,6 +272,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index 5a7416875f2..40f94dae4ef 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * Category Class Doc Comment * * @category Class - * @description A category for a pet * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -265,6 +264,7 @@ public function setName($name) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -277,6 +277,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -290,6 +291,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -306,6 +308,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php index 32c18564255..d42cfc0925a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -235,6 +235,7 @@ public function setClass($_class) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -247,6 +248,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -260,6 +262,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -276,6 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php index c69e66abf91..0bd3cb11df5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function setClient($client) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index a291dfc0310..17cfac809fb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -228,6 +228,7 @@ public function setBreed($breed) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -240,6 +241,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -253,6 +255,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -269,6 +272,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php index 819caf87933..9d6edb75485 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -320,6 +320,7 @@ public function setArrayEnum($array_enum) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -332,6 +333,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -345,6 +347,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -361,6 +364,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index e7e7c94c153..c5878e6d39c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index 146660c23fa..74effb4f178 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -489,6 +489,7 @@ public function setOuterEnum($outer_enum) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -501,6 +502,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -514,6 +516,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -530,6 +533,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 32f17e62537..e38d38430be 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -719,6 +719,7 @@ public function setPassword($password) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -731,6 +732,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -744,6 +746,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -760,6 +763,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php index 4cec0bd4d9a..b019619b179 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -264,6 +264,7 @@ public function setFoo($foo) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -276,6 +277,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -289,6 +291,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -305,6 +308,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php index 8d5e693736d..dbb87bc06d9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -288,6 +288,7 @@ public function setMapOfEnumString($map_of_enum_string) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -300,6 +301,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -313,6 +315,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -329,6 +332,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 66bfc7162ea..8dbe448f32d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -294,6 +294,7 @@ public function setMap($map) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -306,6 +307,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -319,6 +321,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -335,6 +338,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index c3c8d7e28f9..2cfa077f844 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -265,6 +265,7 @@ public function setClass($class) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -277,6 +278,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -290,6 +292,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -306,6 +309,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php index 497546b0633..e1408238ba0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php index 6be35c1b746..375bf310e8a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function set123List($_123_list) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index 12008802e64..e08e1912157 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -235,6 +235,7 @@ public function setReturn($return) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -247,6 +248,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -260,6 +262,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -276,6 +279,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index e8ea7b79a6b..87705fcb6d8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -328,6 +328,7 @@ public function set123Number($_123_number) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -340,6 +341,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -353,6 +355,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -369,6 +372,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php index 6652f04fc23..5dffecc0bcf 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function setJustNumber($just_number) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 8abed8e858e..94569457d08 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * Order Class Doc Comment * * @category Class - * @description An order for a pets from the pet store * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -419,6 +418,7 @@ public function setComplete($complete) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -431,6 +431,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -444,6 +445,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -460,6 +462,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php index da1371e3a49..fbbdccf8453 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterBoolean.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -209,6 +209,7 @@ public function valid() * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -221,6 +222,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -234,6 +236,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -250,6 +253,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php index a1e5bdf9e07..6c23f38a72c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -294,6 +294,7 @@ public function setMyBoolean($my_boolean) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -306,6 +307,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -319,6 +321,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -335,6 +338,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php index 3311c7fe705..79edabface6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php index 6016808d6e8..3c2a1dc0640 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterNumber.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -209,6 +209,7 @@ public function valid() * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -221,6 +222,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -234,6 +236,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -250,6 +253,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php index e10da606d3a..311904480b9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterString.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -209,6 +209,7 @@ public function valid() * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -221,6 +222,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -234,6 +236,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -250,6 +253,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 2502e8b7e4d..a1769b5ec8a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * Pet Class Doc Comment * * @category Class - * @description A pet for sale in the pet store * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -425,6 +424,7 @@ public function setStatus($status) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -437,6 +437,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -450,6 +451,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -466,6 +468,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php index 6e116507205..9ac3e712bf7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -264,6 +264,7 @@ public function setBaz($baz) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -276,6 +277,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -289,6 +291,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -305,6 +308,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index e316c8d9b11..041ed270786 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -234,6 +234,7 @@ public function setSpecialPropertyName($special_property_name) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -246,6 +247,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -259,6 +261,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -275,6 +278,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 3e6025e6eba..3191571c350 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * Tag Class Doc Comment * * @category Class - * @description A tag for a pet * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -265,6 +264,7 @@ public function setName($name) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -277,6 +277,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -290,6 +291,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -306,6 +308,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 1f9ddd22b37..c2312b0b400 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -36,7 +36,6 @@ * User Class Doc Comment * * @category Class - * @description A User who is purchasing from the pet store * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -445,6 +444,7 @@ public function setUserStatus($user_status) * * @return boolean */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); @@ -457,6 +457,7 @@ public function offsetExists($offset) * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; @@ -470,6 +471,7 @@ public function offsetGet($offset) * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (is_null($offset)) { @@ -486,6 +488,7 @@ public function offsetSet($offset, $value) * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index c2148b2a923..5b613f84e6c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -13,12 +13,12 @@ /** * Swagger Petstore * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/phpunit.xml.dist b/samples/client/petstore/php/SwaggerClient-php/phpunit.xml.dist index cadedbc2469..c12ee148477 100644 --- a/samples/client/petstore/php/SwaggerClient-php/phpunit.xml.dist +++ b/samples/client/petstore/php/SwaggerClient-php/phpunit.xml.dist @@ -14,8 +14,8 @@ - ./lib\Api - ./lib\Model + ./lib/Api + ./lib/Model diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/AnotherFakeApiTest.php index 48c09a2ce97..ad4debd96e7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase +class AnotherFakeApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeApiTest.php index dec5918dcba..cd52685ae75 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class FakeApiTest extends \PHPUnit_Framework_TestCase +class FakeApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeClassnameTags123ApiTest.php index 5c1a24eb5c4..5a19bf9982f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class FakeClassnameTags123ApiTest extends \PHPUnit_Framework_TestCase +class FakeClassnameTags123ApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/PetApiTest.php index 892e30c3171..ca98966f580 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class PetApiTest extends \PHPUnit_Framework_TestCase +class PetApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php index c186432170e..bf130507bf2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class StoreApiTest extends \PHPUnit_Framework_TestCase +class StoreApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php index 822e6b84b7f..fe609dd8965 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -40,34 +40,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class UserApiTest extends \PHPUnit_Framework_TestCase +class UserApiTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php index 8ffddf14cc9..a359ea0b8c8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class AdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase +class AdditionalPropertiesClassTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php index 69f3552d76b..ad464737a86 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalFarmTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class AnimalFarmTest extends \PHPUnit_Framework_TestCase +class AnimalFarmTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalTest.php index 9e640ebe0fe..93eea76ceeb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class AnimalTest extends \PHPUnit_Framework_TestCase +class AnimalTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/ApiResponseTest.php index d4a63e88b34..e7089cf7830 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class ApiResponseTest extends \PHPUnit_Framework_TestCase +class ApiResponseTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 779186ca795..32aa3ccf7be 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class ArrayOfArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase +class ArrayOfArrayOfNumberOnlyTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfNumberOnlyTest.php index 332a1d8988a..51beb225876 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class ArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase +class ArrayOfNumberOnlyTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayTestTest.php index d9e06a9b584..61e4a8970a3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.3-SNAPSHOT + * Swagger Codegen version: 2.4.53-SNAPSHOT */ /** @@ -38,34 +38,34 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class ArrayTestTest extends \PHPUnit_Framework_TestCase +class ArrayTestTest extends \PHPUnit\Framework\TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/BooleanTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/BooleanTest.php new file mode 100644 index 00000000000..6cdd5ce2eb4 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/BooleanTest.php @@ -0,0 +1,78 @@ +api = new Api\PetApi(); @@ -63,7 +63,7 @@ public function testAsyncRequestWithHttpInfo() public function testAsyncThrowingException() { - $this->setExpectedException(ApiException::class); + $this->expectException(ApiException::class); $promise = $this->api->getPetByIdAsync(0); $promise->wait(); @@ -77,7 +77,7 @@ public function testAsyncApiExceptionWithoutWaitIsNotThrown() public function testAsyncHttpInfoThrowingException() { - $this->setExpectedException(ApiException::class); + $this->expectException(ApiException::class); $promise = $this->api->getPetByIdAsyncWithHttpInfo(0); $promise->wait(); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/AuthTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/AuthTest.php index d0204352558..1ba3624651f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/AuthTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/AuthTest.php @@ -8,7 +8,7 @@ require_once __DIR__ . '/FakeHttpClient.php'; -class AuthTest extends \PHPUnit_Framework_TestCase +class AuthTest extends \PHPUnit\Framework\TestCase { public function testCustomApiKeyHeader() { diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/DateTimeSerializerTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/DateTimeSerializerTest.php index cea8db4a067..75f122666dc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/DateTimeSerializerTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/DateTimeSerializerTest.php @@ -4,7 +4,7 @@ use Swagger\Client\Model\FormatTest; -class DateTimeSerializerTest extends \PHPUnit_Framework_TestCase +class DateTimeSerializerTest extends \PHPUnit\Framework\TestCase { public function testDateTimeSanitazion() { diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/DebugTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/DebugTest.php index 6eb9dacaffe..6395b1b0e7b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/DebugTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/DebugTest.php @@ -1,7 +1,7 @@ response = $response; } @@ -41,23 +42,23 @@ public function setResponse(ResponseInterface $response = null) * @return ResponseInterface * @throws GuzzleException */ - public function send(RequestInterface $request, array $options = []) + public function send(RequestInterface $request, array $options = []): ResponseInterface { $this->request = $request; return $this->response ?: new Response(200); } - public function sendAsync(RequestInterface $request, array $options = []) + public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface { throw new \RuntimeException('not implemented'); } - public function request($method, $uri, array $options = []) + public function request(string $method, $uri, array $options = []): ResponseInterface { throw new \RuntimeException('not implemented'); } - public function requestAsync($method, $uri, array $options = []) + public function requestAsync(string $method, $uri, array $options = []): PromiseInterface { throw new \RuntimeException('not implemented'); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/FormatTestTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/FormatTestTest.php index e91222a1686..2e8ced07561 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/FormatTestTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/FormatTestTest.php @@ -2,7 +2,7 @@ use Swagger\Client\Model\FormatTest; -class FormatTestTest extends \PHPUnit_Framework_TestCase +class FormatTestTest extends \PHPUnit\Framework\TestCase { public function testCountTheLengthOfMultiByteStringsCorrectly() { diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/HeaderSelectorTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/HeaderSelectorTest.php index 7a89448f89e..eaf4958544d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/HeaderSelectorTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/HeaderSelectorTest.php @@ -2,7 +2,7 @@ namespace Swagger\Client; -class HeaderSelectorTest extends \PHPUnit_Framework_TestCase +class HeaderSelectorTest extends \PHPUnit\Framework\TestCase { public function testSelectingHeaders() { diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/HeadersTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/HeadersTest.php index 5431a912efe..a3dc4c96ce8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/HeadersTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/HeadersTest.php @@ -4,12 +4,12 @@ require_once __DIR__ . '/FakeHttpClient.php'; -class HeadersTest extends \PHPUnit_Framework_TestCase +class HeadersTest extends \PHPUnit\Framework\TestCase { /** @var FakeHttpClient */ private $fakeHttpClient; - public function setUp() + public function setUp(): void { $this->fakeHttpClient = new FakeHttpClient(); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php index 658e60ba638..4b8fc4a2d73 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ModelInheritanceTest.php @@ -12,7 +12,7 @@ * * @package Swagger\Client */ -class ModelInheritanceTest extends \PHPUnit_Framework_TestCase +class ModelInheritanceTest extends \PHPUnit\Framework\TestCase { /** * test if default values works diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ObjectSerializerTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ObjectSerializerTest.php index e81f5b03fc2..3dfb13b669b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ObjectSerializerTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ObjectSerializerTest.php @@ -3,7 +3,7 @@ namespace Swagger\Client; // test object serializer -class ObjectSerializerTest extends \PHPUnit_Framework_TestCase +class ObjectSerializerTest extends \PHPUnit\Framework\TestCase { /** * Test the sanitizeForSerialization method with a stdClass. diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php index 8b5c8f7e499..7b6c5d09548 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php @@ -2,11 +2,11 @@ namespace Swagger\Client; -class OrderApiTest extends \PHPUnit_Framework_TestCase +class OrderApiTest extends \PHPUnit\Framework\TestCase { // add a new pet (id 10005) to ensure the pet object is available for all the tests - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // for error reporting (need to run with php5.3 to get no warning) //ini_set('display_errors', 1); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php index d7d12d5cbb8..3a60ab07115 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php @@ -5,7 +5,7 @@ use Swagger\Client\Model\EnumTest; use Swagger\Client\Model\OuterEnum; -class OuterEnumTest extends \PHPUnit_Framework_TestCase +class OuterEnumTest extends \PHPUnit\Framework\TestCase { public function testDeserialize() { @@ -20,7 +20,7 @@ public function testDeserialize() public function testDeserializeInvalidValue() { - $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid value for enum'); ObjectSerializer::deserialize( "lkjfalgkdfjg", @@ -80,7 +80,7 @@ public function testSanitizeNested() public function testSanitizeNestedInvalidValue() { - $this->setExpectedException(\InvalidArgumentException::class, 'Invalid value for enum'); + $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid value for enum'); $input = new EnumTest([ 'enum_string' => 'UPPER', diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php index 37877556d01..e5dc3fcaa49 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ParametersTest.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/FakeHttpClient.php'; -class ParametersTest extends \PHPUnit_Framework_TestCase +class ParametersTest extends \PHPUnit\Framework\TestCase { /** @var FakeHttpClient */ private $fakeHttpClient; @@ -16,7 +16,7 @@ class ParametersTest extends \PHPUnit_Framework_TestCase /** @var UserApi */ private $userApi; - public function setUp() + public function setUp(): void { $this->fakeHttpClient = new FakeHttpClient(); $this->fakeApi = new Api\FakeApi($this->fakeHttpClient); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php index 1cfad6aaeae..3966b2b6f1f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php @@ -6,14 +6,14 @@ use Swagger\Client\Model\ApiResponse; use Swagger\Client\Model\Pet; -class PetApiTest extends \PHPUnit_Framework_TestCase +class PetApiTest extends \PHPUnit\Framework\TestCase { /** @var PetApi */ private $api; // add a new pet (id 10005) to ensure the pet object is available for all the tests - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // increase memory limit to avoid fatal error due to findPetByStatus // returning a lot of data @@ -45,10 +45,10 @@ public static function setUpBeforeClass() // add a new pet (model) list(, $status) = $petApi->addPetWithHttpInfo($newPet); - \PHPUnit_Framework_Assert::assertEquals(200, $status); + \PHPUnit\Framework\Assert::assertEquals(200, $status); } - public function setUp() + public function setUp(): void { $this->api = new Api\PetApi(); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetTest.php index 60ce604c522..7ddb44622ca 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetTest.php @@ -4,7 +4,7 @@ use Swagger\Client\Model\Pet; -class PetTest extends \PHPUnit_Framework_TestCase +class PetTest extends \PHPUnit\Framework\TestCase { /** * test empty object serialization diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/RequestTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/RequestTest.php index 779ae71ab02..66a89df974a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/RequestTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/RequestTest.php @@ -4,7 +4,7 @@ use Swagger\Client\Api\FakeApi; -class RequestTest extends \PHPUnit_Framework_TestCase +class RequestTest extends \PHPUnit\Framework\TestCase { /** @var FakeApi */ @@ -12,7 +12,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase /** @var FakeHttpClient */ private $fakeClient; - public function setUp() + public function setUp(): void { $this->fakeClient = new FakeHttpClient(); $this->api = new Api\FakeApi($this->fakeClient); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php index 71eda338ba9..6b4b87ddbe0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php @@ -8,14 +8,14 @@ require_once __DIR__ . '/FakeHttpClient.php'; -class ResponseTypesTest extends \PHPUnit_Framework_TestCase +class ResponseTypesTest extends \PHPUnit\Framework\TestCase { /** @var PetApi */ private $api; /** @var FakeHttpClient */ private $fakeHttpClient; - public function setUp() + public function setUp(): void { $this->fakeHttpClient = new FakeHttpClient(); $this->api = new PetApi($this->fakeHttpClient); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php index 3af84b8d851..9dc6b92a7db 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php @@ -8,12 +8,12 @@ use Swagger\Client\Model\Pet; use Swagger\Client\Model\Tag; -class StoreApiTest extends \PHPUnit_Framework_TestCase +class StoreApiTest extends \PHPUnit\Framework\TestCase { /** @var StoreApi */ private $api; - public function setUp() + public function setUp(): void { $this->api = new StoreApi(); } @@ -21,7 +21,7 @@ public function setUp() /** * Setup before running each test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // add a new pet (id 10005) to ensure the pet object is available for all the tests // new pet diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php index fdaf42467e1..808ec3c31d6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php @@ -4,13 +4,13 @@ use Swagger\Client\Api\UserApi; -class UserApiTest extends \PHPUnit_Framework_TestCase +class UserApiTest extends \PHPUnit\Framework\TestCase { /** @var UserApi*/ private $api; - public function setUp() + public function setUp(): void { $this->api = new Api\UserApi(); } diff --git a/samples/server/petstore/php-symfony/.swagger-codegen/VERSION b/samples/server/petstore/php-symfony/.swagger-codegen/VERSION index 0e6df709793..bab531eaf33 100644 --- a/samples/server/petstore/php-symfony/.swagger-codegen/VERSION +++ b/samples/server/petstore/php-symfony/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.5-SNAPSHOT \ No newline at end of file +2.4.53-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json index 1834f482225..2001aa4aa19 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json @@ -27,7 +27,7 @@ "require-dev": { "phpunit/phpunit": "~4.8", "satooshi/php-coveralls": "~1.0", - "squizlabs/php_codesniffer": "~2.6", + "squizlabs/php_codesniffer": "^3.0", "friendsofphp/php-cs-fixer": "~1.12", "symfony/browser-kit": "*", "hoa/regex": "~1.0" From 5e491b0dbf95ab36096b340970d6bd3acf3f13f8 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Mon, 19 Oct 2026 15:23:10 +0200 Subject: [PATCH 3/6] chore: update swagger-ui default branch to main --- modules/swagger-generator/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 3ec3339a39d..e87f75473b0 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -73,7 +73,7 @@ - ${project.build.directory}/swagger-ui-master/dist + ${project.build.directory}/swagger-ui-main/dist index.html @@ -144,7 +144,7 @@ wget - https://github.com/swagger-api/swagger-ui/archive/master.tar.gz + https://github.com/swagger-api/swagger-ui/archive/main.tar.gz true ${project.build.directory} From 334dfc7c2fee72824b9ebe5155018bd5b6b403f8 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Tue, 20 Oct 2026 09:59:23 +0200 Subject: [PATCH 4/6] fix(php): handle Guzzle 8 exceptions without response in generated APIs Guzzle 8 moved getResponse() from RequestException to ResponseException and ConnectException no longer extends RequestException. The generated sync and async handlers called getResponse() unconditionally, so connection errors escaped as raw Guzzle exceptions or as an undefined-method Error. Catch ResponseException (error responses) and TransferException (anything without a response, e.g. connection errors) and wrap both in ApiException. --- .../src/main/resources/php/api.mustache | 39 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 39 +- .../lib/Api/AnotherFakeApi.php | 39 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 363 +++++++++++------- .../lib/Api/FakeClassnameTags123Api.php | 39 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 291 +++++++++----- .../SwaggerClient-php/lib/Api/StoreApi.php | 147 ++++--- .../php/SwaggerClient-php/lib/Api/UserApi.php | 291 +++++++++----- 8 files changed, 798 insertions(+), 450 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index ab2df5255ce..049d68647e3 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -20,7 +20,8 @@ namespace {{apiPackage}}; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -131,13 +132,17 @@ use {{invokerPackage}}\ObjectSerializer; $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -268,17 +273,23 @@ use {{invokerPackage}}\ObjectSerializer; {{/returnType}} }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index 840e4ebc657..dcc11dc3223 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -123,13 +124,17 @@ public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -198,17 +203,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index 400df721516..b1e7c2afe7f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -124,13 +125,17 @@ public function testSpecialTagsWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -235,17 +240,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index a0fcbaebf08..c338d0f1c5b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -120,13 +121,17 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -231,17 +236,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -374,13 +385,17 @@ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -485,17 +500,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -628,13 +649,17 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -739,17 +764,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -882,13 +913,17 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -993,17 +1028,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1137,13 +1178,17 @@ public function testBodyWithQueryParamsWithHttpInfo($body, $query) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1214,17 +1259,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1378,13 +1429,17 @@ public function testClientModelWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1489,17 +1544,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1667,13 +1728,17 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1768,17 +1833,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -2069,13 +2140,17 @@ public function testEnumParametersWithHttpInfo($enum_form_string_array = null, $ $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -2158,17 +2233,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -2346,13 +2427,17 @@ public function testInlineAdditionalPropertiesWithHttpInfo($param) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -2421,17 +2506,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -2575,13 +2666,17 @@ public function testJsonFormDataWithHttpInfo($param, $param2) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -2652,17 +2747,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index 99bde82fb42..b471e0fe424 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -124,13 +125,17 @@ public function testClassnameWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -235,17 +240,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index e478aee3772..bdf72bd429e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -123,13 +124,17 @@ public function addPetWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -198,17 +203,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -356,13 +367,17 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -433,17 +448,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -600,13 +621,17 @@ public function findPetsByStatusWithHttpInfo($status) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -711,17 +736,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -872,13 +903,17 @@ public function findPetsByTagsWithHttpInfo($tags) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -983,17 +1018,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1144,13 +1185,17 @@ public function getPetByIdWithHttpInfo($pet_id) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1255,17 +1300,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1417,13 +1468,17 @@ public function updatePetWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1492,17 +1547,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1652,13 +1713,17 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1731,17 +1796,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1907,13 +1978,17 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -2022,17 +2097,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index a7a5289d6c8..a5989679100 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -123,13 +124,17 @@ public function deleteOrderWithHttpInfo($order_id) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -198,17 +203,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -354,13 +365,17 @@ public function getInventoryWithHttpInfo() $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -463,17 +478,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -611,13 +632,17 @@ public function getOrderByIdWithHttpInfo($order_id) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -722,17 +747,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -887,13 +918,17 @@ public function placeOrderWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -998,17 +1033,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 17206c2328e..11d3e7a315a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -30,7 +30,8 @@ use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ResponseException; +use GuzzleHttp\Exception\TransferException; use GuzzleHttp\Psr7\MultipartStream; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; @@ -123,13 +124,17 @@ public function createUserWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -198,17 +203,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -350,13 +361,17 @@ public function createUsersWithArrayInputWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -425,17 +440,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -577,13 +598,17 @@ public function createUsersWithListInputWithHttpInfo($body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -652,17 +677,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -804,13 +835,17 @@ public function deleteUserWithHttpInfo($username) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -879,17 +914,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1037,13 +1078,17 @@ public function getUserByNameWithHttpInfo($username) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1148,17 +1193,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1308,13 +1359,17 @@ public function loginUserWithHttpInfo($username, $password) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1421,17 +1476,23 @@ function ($response) use ($returnType) { ]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1583,13 +1644,17 @@ public function logoutUserWithHttpInfo() $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1656,17 +1721,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); @@ -1800,13 +1871,17 @@ public function updateUserWithHttpInfo($username, $body) $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); - } catch (RequestException $e) { + } catch (ResponseException $e) { + $response = $e->getResponse(); throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $response->getHeaders(), + $response->getBody()->getContents() ); + } catch (TransferException $e) { + // e.g. connection errors: there is no response + throw new ApiException("[{$e->getCode()}] {$e->getMessage()}", $e->getCode()); } $statusCode = $response->getStatusCode(); @@ -1877,17 +1952,23 @@ function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', + if ($exception instanceof ResponseException) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $response->getHeaders(), + $response->getBody() + ); + } + throw new ApiException( + sprintf('[%d] Error connecting to the API (%s)', $exception->getCode(), $exception->getMessage()), + $exception->getCode() ); } ); From e4d2a11d65fd53ddeec2fb97fd82bd1373f69a62 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Tue, 20 Oct 2026 09:59:24 +0200 Subject: [PATCH 5/6] chore(php): migrate to PHPUnit 9 and PHP-CS-Fixer 3 PHP-CS-Fixer 2.x does not run on PHP 8.3 and 3.x resolves to a fixer without PHP 8.3 support when combined with PHPUnit 8.5 (sebastian/diff conflict). - generated composer.json: phpunit ^9.6, php-cs-fixer ^3.0 - rename the generated fixer config .php_cs -> .php-cs-fixer.php (required by fixer 3), use the PHP 8.3 compatible (new Config()) form and allow the risky rules it already enabled - PhpClientCodegen: supporting file name follows the rename - regenerate PHP client samples - sample tests: replace @expectedException* annotations and assertInternalType, both removed in PHPUnit 9 --- .../codegen/languages/PhpClientCodegen.java | 2 +- .../resources/php/{.php_cs => .php-cs-fixer.php} | 3 ++- .../src/main/resources/php/composer.mustache | 4 ++-- .../{.php_cs => .php-cs-fixer.php} | 3 ++- .../php/SwaggerClient-php/composer.json | 4 ++-- .../{.php_cs => .php-cs-fixer.php} | 3 ++- .../petstore/php/SwaggerClient-php/composer.json | 4 ++-- .../php/SwaggerClient-php/tests/AsyncTest.php | 2 +- .../php/SwaggerClient-php/tests/EnumTestTest.php | 4 +--- .../php/SwaggerClient-php/tests/ExceptionTest.php | 14 +++++--------- .../php/SwaggerClient-php/tests/OrderApiTest.php | 4 +--- .../php/SwaggerClient-php/tests/OuterEnumTest.php | 8 ++++---- .../php/SwaggerClient-php/tests/PetApiTest.php | 9 ++++----- .../SwaggerClient-php/tests/ResponseTypesTest.php | 12 ++++-------- .../php/SwaggerClient-php/tests/StoreApiTest.php | 4 ++-- .../php/SwaggerClient-php/tests/UserApiTest.php | 2 +- 16 files changed, 36 insertions(+), 46 deletions(-) rename modules/swagger-codegen/src/main/resources/php/{.php_cs => .php-cs-fixer.php} (91%) rename samples/client/petstore-security-test/php/SwaggerClient-php/{.php_cs => .php-cs-fixer.php} (91%) rename samples/client/petstore/php/SwaggerClient-php/{.php_cs => .php-cs-fixer.php} (91%) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index ffaed0e5e16..4fe7304f7ee 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -316,7 +316,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md")); supportingFiles.add(new SupportingFile("phpunit.xml.mustache", getPackagePath(), "phpunit.xml.dist")); supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml")); - supportingFiles.add(new SupportingFile(".php_cs", getPackagePath(), ".php_cs")); + supportingFiles.add(new SupportingFile(".php-cs-fixer.php", getPackagePath(), ".php-cs-fixer.php")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", getPackagePath(), "git_push.sh")); } diff --git a/modules/swagger-codegen/src/main/resources/php/.php_cs b/modules/swagger-codegen/src/main/resources/php/.php-cs-fixer.php similarity index 91% rename from modules/swagger-codegen/src/main/resources/php/.php_cs rename to modules/swagger-codegen/src/main/resources/php/.php-cs-fixer.php index 4fbe53ec5ff..dc702622b95 100644 --- a/modules/swagger-codegen/src/main/resources/php/.php_cs +++ b/modules/swagger-codegen/src/main/resources/php/.php-cs-fixer.php @@ -1,7 +1,8 @@ setUsingCache(true) + ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, 'ordered_imports' => true, diff --git a/modules/swagger-codegen/src/main/resources/php/composer.mustache b/modules/swagger-codegen/src/main/resources/php/composer.mustache index 90612fac727..c9b66bbb39c 100644 --- a/modules/swagger-codegen/src/main/resources/php/composer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/composer.mustache @@ -26,9 +26,9 @@ "guzzlehttp/guzzle": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.52", + "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.0", - "friendsofphp/php-cs-fixer": "~2.12" + "friendsofphp/php-cs-fixer": "^3.0" }, "autoload": { "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs b/samples/client/petstore-security-test/php/SwaggerClient-php/.php-cs-fixer.php similarity index 91% rename from samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs rename to samples/client/petstore-security-test/php/SwaggerClient-php/.php-cs-fixer.php index 4fbe53ec5ff..dc702622b95 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/.php_cs +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/.php-cs-fixer.php @@ -1,7 +1,8 @@ setUsingCache(true) + ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, 'ordered_imports' => true, diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json index 3fba36ac1de..86b5a5cd12b 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/composer.json @@ -23,9 +23,9 @@ "guzzlehttp/guzzle": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.52", + "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.0", - "friendsofphp/php-cs-fixer": "~2.12" + "friendsofphp/php-cs-fixer": "^3.0" }, "autoload": { "psr-4": { "Swagger\\Client\\" : "lib/" } diff --git a/samples/client/petstore/php/SwaggerClient-php/.php_cs b/samples/client/petstore/php/SwaggerClient-php/.php-cs-fixer.php similarity index 91% rename from samples/client/petstore/php/SwaggerClient-php/.php_cs rename to samples/client/petstore/php/SwaggerClient-php/.php-cs-fixer.php index 4fbe53ec5ff..dc702622b95 100644 --- a/samples/client/petstore/php/SwaggerClient-php/.php_cs +++ b/samples/client/petstore/php/SwaggerClient-php/.php-cs-fixer.php @@ -1,7 +1,8 @@ setUsingCache(true) + ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, 'ordered_imports' => true, diff --git a/samples/client/petstore/php/SwaggerClient-php/composer.json b/samples/client/petstore/php/SwaggerClient-php/composer.json index 3fba36ac1de..86b5a5cd12b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/composer.json +++ b/samples/client/petstore/php/SwaggerClient-php/composer.json @@ -23,9 +23,9 @@ "guzzlehttp/guzzle": "^8.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.52", + "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.0", - "friendsofphp/php-cs-fixer": "~2.12" + "friendsofphp/php-cs-fixer": "^3.0" }, "autoload": { "psr-4": { "Swagger\\Client\\" : "lib/" } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/AsyncTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/AsyncTest.php index 1d5dd82856c..b7564933784 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/AsyncTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/AsyncTest.php @@ -57,7 +57,7 @@ public function testAsyncRequestWithHttpInfo() list($pet, $status, $headers) = $promise->wait(); $this->assertEquals(200, $status); - $this->assertInternalType('array', $headers); + $this->assertIsArray($headers); $this->assertInstanceOf(Pet::class, $pet); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php index 61f03eeb6a0..419d7e747f7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/EnumTestTest.php @@ -31,11 +31,9 @@ public function testStrictValidation() $this->assertSame($expected, $enum->listInvalidProperties()); } - /** - * @expectedException \InvalidArgumentException - */ public function testThrowExceptionWhenInvalidAmbiguousValueHasPassed() { + $this->expectException(\InvalidArgumentException::class); $enum = new EnumTest(); $enum->setEnumString(0); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ExceptionTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ExceptionTest.php index 3295b5753f2..acb0c2bb59b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ExceptionTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ExceptionTest.php @@ -6,13 +6,11 @@ class ExceptionTest extends \PHPUnit\Framework\TestCase { - /** - * @expectedException \Swagger\Client\ApiException - * @expectedExceptionCode 404 - * @expectedExceptionMessage http://petstore.swagger.io/INVALID_URL/store/inventory - */ public function testNotFound() { + $this->expectException(\Swagger\Client\ApiException::class); + $this->expectExceptionCode(404); + $this->expectExceptionMessage('http://petstore.swagger.io/INVALID_URL/store/inventory'); $config = new Configuration(); $config->setHost('http://petstore.swagger.io/INVALID_URL'); @@ -23,12 +21,10 @@ public function testNotFound() $api->getInventory(); } - /** - * @expectedException \Swagger\Client\ApiException - * @expectedExceptionMessage Could not resolve host - */ public function testWrongHost() { + $this->expectException(\Swagger\Client\ApiException::class); + $this->expectExceptionMessage('Could not resolve host'); $config = new Configuration(); $config->setHost('http://wrong_host.zxc'); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php index 7b6c5d09548..2ca4c30c77b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OrderApiTest.php @@ -30,11 +30,9 @@ public function testOrder() $this->assertSame("placed", $order->getStatus()); } - /** - * @expectedException InvalidArgumentException - */ public function testOrderException() { + $this->expectException(\InvalidArgumentException::class); // initialize the API client $order = new Model\Order(); $order->setStatus("invalid_value"); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php index 3a60ab07115..5a9581f104c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/OuterEnumTest.php @@ -14,7 +14,7 @@ public function testDeserialize() OuterEnum::class ); - $this->assertInternalType('string', $result); + $this->assertIsString($result); $this->assertEquals('placed', $result); } @@ -55,7 +55,7 @@ public function testSanitize() $json ); - $this->assertInternalType('string', $result); + $this->assertIsString($result); } public function testSanitizeNested() @@ -71,10 +71,10 @@ public function testSanitizeNested() $input ); - $this->assertInternalType('object', $result); + $this->assertIsObject($result); $this->assertInstanceOf(\stdClass::class, $result); - $this->assertInternalType('string', $result->outerEnum); + $this->assertIsString($result->outerEnum); $this->assertEquals('approved', $result->outerEnum); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php index 3966b2b6f1f..46f5e962c2c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/PetApiTest.php @@ -86,7 +86,7 @@ public function testGetPetById() * $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com'); * * // category is type "object" - * $this->assertInternalType('array', $response->getCategory()); + * $this->assertIsArray($response->getCategory()); * $this->assertSame($response->getCategory()['id'], $pet_id); * $this->assertSame($response->getCategory()['name'], 'test php category'); * @@ -278,7 +278,7 @@ public function testGetPetByIdWithByteArray() $bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id); $json = json_decode($bytes, true); - $this->assertInternalType("string", $bytes); + $this->assertIsString($bytes); $this->assertSame($json['id'], $pet_id); // not testing name as it's tested by addPetUsingByteArray @@ -375,12 +375,11 @@ public function testDefaultValues() /** * test invalid argument - * - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Missing the required parameter $status when calling findPetsByStatus */ public function testInvalidArgument() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Missing the required parameter $status when calling findPetsByStatus'); // the argument is required, and we must specify one or some from 'available', 'pending', 'sold' $this->api->findPetsByStatus([]); } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php index 6b4b87ddbe0..6b2257e5073 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/ResponseTypesTest.php @@ -37,12 +37,10 @@ public function testDefault2xxReturnType() $this->assertInstanceOf(Pet::class, $result); } - /** - * @expectedException \Swagger\Client\ApiException - * @expectedExceptionCode 400 - */ public function testDefinedErrorException() { + $this->expectException(\Swagger\Client\ApiException::class); + $this->expectExceptionCode(400); $statusCode = 400; $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); @@ -68,12 +66,10 @@ public function testDefinedErrorException() // $this->assertInstanceOf(Error::class, $result); // } - /** - * @expectedException \Swagger\Client\ApiException - * @expectedExceptionCode 404 - */ public function testDefaultErrorException() { + $this->expectException(\Swagger\Client\ApiException::class); + $this->expectExceptionCode(404); $statusCode = 404; $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php index 9dc6b92a7db..6be4d931bee 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/StoreApiTest.php @@ -50,7 +50,7 @@ public function testGetInventory() { $result = $this->api->getInventory(); - $this->assertInternalType('array', $result); - $this->assertInternalType('int', $result['available']); + $this->assertIsArray($result); + $this->assertIsInt($result['available']); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php index 808ec3c31d6..9283c6e7337 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php @@ -22,7 +22,7 @@ public function testLoginUser() // login $response = $this->api->loginUser('xxxxx', 'yyyyyyyy'); - $this->assertInternalType('string', $response); + $this->assertIsString($response); $this->assertRegExp( '/logged in user session/', $response, From 28040dd18adba4259a6a61cedca04d089a0a62c8 Mon Sep 17 00:00:00 2001 From: Daniel Kmiecik Date: Tue, 20 Oct 2026 12:06:32 +0200 Subject: [PATCH 6/6] docs(php): document JsonException and no-response failures in generated API docblocks --- .../src/main/resources/php/api.mustache | 9 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 9 +- .../lib/Api/AnotherFakeApi.php | 9 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 90 ++++++++++++++----- .../lib/Api/FakeClassnameTags123Api.php | 9 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 72 +++++++++++---- .../SwaggerClient-php/lib/Api/StoreApi.php | 36 ++++++-- .../php/SwaggerClient-php/lib/Api/UserApi.php | 72 +++++++++++---- 8 files changed, 238 insertions(+), 68 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 049d68647e3..5b11cb3b1d1 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -94,8 +94,9 @@ use {{invokerPackage}}\ObjectSerializer; * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * - * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \{{invokerPackage}}\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -119,8 +120,9 @@ use {{invokerPackage}}\ObjectSerializer; * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * - * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \{{invokerPackage}}\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) */ public function {{operationId}}WithHttpInfo({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -214,6 +216,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/allParams}} * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function {{operationId}}Async({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -240,6 +243,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/allParams}} * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function {{operationId}}AsyncWithHttpInfo({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) @@ -303,6 +307,7 @@ use {{invokerPackage}}\ObjectSerializer; {{/allParams}} * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function {{operationId}}Request({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index dcc11dc3223..52c61afff2b 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -95,8 +95,9 @@ public function getConfig() * * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testCodeInjectEndRnNR($test_code_inject____end____rn_n_r = null) @@ -111,8 +112,9 @@ public function testCodeInjectEndRnNR($test_code_inject____end____rn_n_r = null) * * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn_n_r = null) @@ -169,6 +171,7 @@ public function testCodeInjectEndRnNRWithHttpInfo($test_code_inject____end____rn * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testCodeInjectEndRnNRAsync($test_code_inject____end____rn_n_r = null) @@ -189,6 +192,7 @@ function ($response) { * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testCodeInjectEndRnNRAsyncWithHttpInfo($test_code_inject____end____rn_n_r = null) @@ -231,6 +235,7 @@ function ($exception) { * @param string $test_code_inject____end____rn_n_r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n_r = null) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index b1e7c2afe7f..f4ccb16b2f9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -95,8 +95,9 @@ public function getConfig() * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Client */ public function testSpecialTags($body) @@ -112,8 +113,9 @@ public function testSpecialTags($body) * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ public function testSpecialTagsWithHttpInfo($body) @@ -192,6 +194,7 @@ public function testSpecialTagsWithHttpInfo($body) * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testSpecialTagsAsync($body) @@ -212,6 +215,7 @@ function ($response) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testSpecialTagsAsyncWithHttpInfo($body) @@ -268,6 +272,7 @@ function ($exception) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testSpecialTagsRequest($body) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index c338d0f1c5b..c479a8e2fd2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -93,8 +93,9 @@ public function getConfig() * * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\OuterBoolean */ public function fakeOuterBooleanSerialize($body = null) @@ -108,8 +109,9 @@ public function fakeOuterBooleanSerialize($body = null) * * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\OuterBoolean, HTTP status code, HTTP response headers (array of strings) */ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) @@ -188,6 +190,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterBooleanSerializeAsync($body = null) @@ -208,6 +211,7 @@ function ($response) { * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterBooleanSerializeAsyncWithHttpInfo($body = null) @@ -264,6 +268,7 @@ function ($exception) { * @param \Swagger\Client\Model\OuterBoolean $body Input boolean as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function fakeOuterBooleanSerializeRequest($body = null) @@ -357,8 +362,9 @@ protected function fakeOuterBooleanSerializeRequest($body = null) * * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\OuterComposite */ public function fakeOuterCompositeSerialize($body = null) @@ -372,8 +378,9 @@ public function fakeOuterCompositeSerialize($body = null) * * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) */ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) @@ -452,6 +459,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo($body = null) * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterCompositeSerializeAsync($body = null) @@ -472,6 +480,7 @@ function ($response) { * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterCompositeSerializeAsyncWithHttpInfo($body = null) @@ -528,6 +537,7 @@ function ($exception) { * @param \Swagger\Client\Model\OuterComposite $body Input composite as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function fakeOuterCompositeSerializeRequest($body = null) @@ -621,8 +631,9 @@ protected function fakeOuterCompositeSerializeRequest($body = null) * * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\OuterNumber */ public function fakeOuterNumberSerialize($body = null) @@ -636,8 +647,9 @@ public function fakeOuterNumberSerialize($body = null) * * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\OuterNumber, HTTP status code, HTTP response headers (array of strings) */ public function fakeOuterNumberSerializeWithHttpInfo($body = null) @@ -716,6 +728,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterNumberSerializeAsync($body = null) @@ -736,6 +749,7 @@ function ($response) { * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterNumberSerializeAsyncWithHttpInfo($body = null) @@ -792,6 +806,7 @@ function ($exception) { * @param \Swagger\Client\Model\OuterNumber $body Input number as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function fakeOuterNumberSerializeRequest($body = null) @@ -885,8 +900,9 @@ protected function fakeOuterNumberSerializeRequest($body = null) * * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\OuterString */ public function fakeOuterStringSerialize($body = null) @@ -900,8 +916,9 @@ public function fakeOuterStringSerialize($body = null) * * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\OuterString, HTTP status code, HTTP response headers (array of strings) */ public function fakeOuterStringSerializeWithHttpInfo($body = null) @@ -980,6 +997,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterStringSerializeAsync($body = null) @@ -1000,6 +1018,7 @@ function ($response) { * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function fakeOuterStringSerializeAsyncWithHttpInfo($body = null) @@ -1056,6 +1075,7 @@ function ($exception) { * @param \Swagger\Client\Model\OuterString $body Input string as post body (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function fakeOuterStringSerializeRequest($body = null) @@ -1150,8 +1170,9 @@ protected function fakeOuterStringSerializeRequest($body = null) * @param \Swagger\Client\Model\User $body body (required) * @param string $query query (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testBodyWithQueryParams($body, $query) @@ -1165,8 +1186,9 @@ public function testBodyWithQueryParams($body, $query) * @param \Swagger\Client\Model\User $body (required) * @param string $query (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testBodyWithQueryParamsWithHttpInfo($body, $query) @@ -1224,6 +1246,7 @@ public function testBodyWithQueryParamsWithHttpInfo($body, $query) * @param string $query (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testBodyWithQueryParamsAsync($body, $query) @@ -1245,6 +1268,7 @@ function ($response) { * @param string $query (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testBodyWithQueryParamsAsyncWithHttpInfo($body, $query) @@ -1288,6 +1312,7 @@ function ($exception) { * @param string $query (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testBodyWithQueryParamsRequest($body, $query) @@ -1399,8 +1424,9 @@ protected function testBodyWithQueryParamsRequest($body, $query) * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Client */ public function testClientModel($body) @@ -1416,8 +1442,9 @@ public function testClientModel($body) * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ public function testClientModelWithHttpInfo($body) @@ -1496,6 +1523,7 @@ public function testClientModelWithHttpInfo($body) * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClientModelAsync($body) @@ -1516,6 +1544,7 @@ function ($response) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClientModelAsyncWithHttpInfo($body) @@ -1572,6 +1601,7 @@ function ($exception) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testClientModelRequest($body) @@ -1686,8 +1716,9 @@ protected function testClientModelRequest($body) * @param string $password None (optional) * @param string $callback None (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) @@ -1715,8 +1746,9 @@ public function testEndpointParameters($number, $double, $pattern_without_delimi * @param string $password None (optional) * @param string $callback None (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) @@ -1786,6 +1818,7 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi * @param string $callback None (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) @@ -1819,6 +1852,7 @@ function ($response) { * @param string $callback None (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) @@ -1874,6 +1908,7 @@ function ($exception) { * @param string $callback None (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) @@ -2104,8 +2139,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with * @param int $enum_query_integer Query parameter enum test (double) (optional) * @param double $enum_query_double Query parameter enum test (double) (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testEnumParameters($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) @@ -2127,8 +2163,9 @@ public function testEnumParameters($enum_form_string_array = null, $enum_form_st * @param int $enum_query_integer Query parameter enum test (double) (optional) * @param double $enum_query_double Query parameter enum test (double) (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testEnumParametersWithHttpInfo($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) @@ -2192,6 +2229,7 @@ public function testEnumParametersWithHttpInfo($enum_form_string_array = null, $ * @param double $enum_query_double Query parameter enum test (double) (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEnumParametersAsync($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) @@ -2219,6 +2257,7 @@ function ($response) { * @param double $enum_query_double Query parameter enum test (double) (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testEnumParametersAsyncWithHttpInfo($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) @@ -2268,6 +2307,7 @@ function ($exception) { * @param double $enum_query_double Query parameter enum test (double) (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testEnumParametersRequest($enum_form_string_array = null, $enum_form_string = '-efg', $enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null) @@ -2398,8 +2438,9 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en * * @param object $param request body (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testInlineAdditionalProperties($param) @@ -2414,8 +2455,9 @@ public function testInlineAdditionalProperties($param) * * @param object $param request body (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testInlineAdditionalPropertiesWithHttpInfo($param) @@ -2472,6 +2514,7 @@ public function testInlineAdditionalPropertiesWithHttpInfo($param) * @param object $param request body (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testInlineAdditionalPropertiesAsync($param) @@ -2492,6 +2535,7 @@ function ($response) { * @param object $param request body (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testInlineAdditionalPropertiesAsyncWithHttpInfo($param) @@ -2534,6 +2578,7 @@ function ($exception) { * @param object $param request body (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testInlineAdditionalPropertiesRequest($param) @@ -2636,8 +2681,9 @@ protected function testInlineAdditionalPropertiesRequest($param) * @param string $param field1 (required) * @param string $param2 field2 (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function testJsonFormData($param, $param2) @@ -2653,8 +2699,9 @@ public function testJsonFormData($param, $param2) * @param string $param field1 (required) * @param string $param2 field2 (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function testJsonFormDataWithHttpInfo($param, $param2) @@ -2712,6 +2759,7 @@ public function testJsonFormDataWithHttpInfo($param, $param2) * @param string $param2 field2 (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testJsonFormDataAsync($param, $param2) @@ -2733,6 +2781,7 @@ function ($response) { * @param string $param2 field2 (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testJsonFormDataAsyncWithHttpInfo($param, $param2) @@ -2776,6 +2825,7 @@ function ($exception) { * @param string $param2 field2 (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testJsonFormDataRequest($param, $param2) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index b471e0fe424..c5806b89ab7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -95,8 +95,9 @@ public function getConfig() * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Client */ public function testClassname($body) @@ -112,8 +113,9 @@ public function testClassname($body) * * @param \Swagger\Client\Model\Client $body client model (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Client, HTTP status code, HTTP response headers (array of strings) */ public function testClassnameWithHttpInfo($body) @@ -192,6 +194,7 @@ public function testClassnameWithHttpInfo($body) * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClassnameAsync($body) @@ -212,6 +215,7 @@ function ($response) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClassnameAsyncWithHttpInfo($body) @@ -268,6 +272,7 @@ function ($exception) { * @param \Swagger\Client\Model\Client $body client model (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function testClassnameRequest($body) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index bdf72bd429e..6429759b566 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -95,8 +95,9 @@ public function getConfig() * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function addPet($body) @@ -111,8 +112,9 @@ public function addPet($body) * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function addPetWithHttpInfo($body) @@ -169,6 +171,7 @@ public function addPetWithHttpInfo($body) * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function addPetAsync($body) @@ -189,6 +192,7 @@ function ($response) { * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function addPetAsyncWithHttpInfo($body) @@ -231,6 +235,7 @@ function ($exception) { * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function addPetRequest($body) @@ -337,8 +342,9 @@ protected function addPetRequest($body) * @param int $pet_id Pet id to delete (required) * @param string $api_key api_key (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function deletePet($pet_id, $api_key = null) @@ -354,8 +360,9 @@ public function deletePet($pet_id, $api_key = null) * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function deletePetWithHttpInfo($pet_id, $api_key = null) @@ -413,6 +420,7 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) * @param string $api_key (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deletePetAsync($pet_id, $api_key = null) @@ -434,6 +442,7 @@ function ($response) { * @param string $api_key (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) @@ -477,6 +486,7 @@ function ($exception) { * @param string $api_key (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function deletePetRequest($pet_id, $api_key = null) @@ -591,8 +601,9 @@ protected function deletePetRequest($pet_id, $api_key = null) * * @param string[] $status Status values that need to be considered for filter (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Pet[] */ public function findPetsByStatus($status) @@ -608,8 +619,9 @@ public function findPetsByStatus($status) * * @param string[] $status Status values that need to be considered for filter (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) */ public function findPetsByStatusWithHttpInfo($status) @@ -688,6 +700,7 @@ public function findPetsByStatusWithHttpInfo($status) * @param string[] $status Status values that need to be considered for filter (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByStatusAsync($status) @@ -708,6 +721,7 @@ function ($response) { * @param string[] $status Status values that need to be considered for filter (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByStatusAsyncWithHttpInfo($status) @@ -764,6 +778,7 @@ function ($exception) { * @param string[] $status Status values that need to be considered for filter (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function findPetsByStatusRequest($status) @@ -873,8 +888,9 @@ protected function findPetsByStatusRequest($status) * * @param string[] $tags Tags to filter by (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Pet[] */ public function findPetsByTags($tags) @@ -890,8 +906,9 @@ public function findPetsByTags($tags) * * @param string[] $tags Tags to filter by (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Pet[], HTTP status code, HTTP response headers (array of strings) */ public function findPetsByTagsWithHttpInfo($tags) @@ -970,6 +987,7 @@ public function findPetsByTagsWithHttpInfo($tags) * @param string[] $tags Tags to filter by (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByTagsAsync($tags) @@ -990,6 +1008,7 @@ function ($response) { * @param string[] $tags Tags to filter by (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function findPetsByTagsAsyncWithHttpInfo($tags) @@ -1046,6 +1065,7 @@ function ($exception) { * @param string[] $tags Tags to filter by (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function findPetsByTagsRequest($tags) @@ -1155,8 +1175,9 @@ protected function findPetsByTagsRequest($tags) * * @param int $pet_id ID of pet to return (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Pet */ public function getPetById($pet_id) @@ -1172,8 +1193,9 @@ public function getPetById($pet_id) * * @param int $pet_id ID of pet to return (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Pet, HTTP status code, HTTP response headers (array of strings) */ public function getPetByIdWithHttpInfo($pet_id) @@ -1252,6 +1274,7 @@ public function getPetByIdWithHttpInfo($pet_id) * @param int $pet_id ID of pet to return (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getPetByIdAsync($pet_id) @@ -1272,6 +1295,7 @@ function ($response) { * @param int $pet_id ID of pet to return (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getPetByIdAsyncWithHttpInfo($pet_id) @@ -1328,6 +1352,7 @@ function ($exception) { * @param int $pet_id ID of pet to return (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function getPetByIdRequest($pet_id) @@ -1439,8 +1464,9 @@ protected function getPetByIdRequest($pet_id) * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function updatePet($body) @@ -1455,8 +1481,9 @@ public function updatePet($body) * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function updatePetWithHttpInfo($body) @@ -1513,6 +1540,7 @@ public function updatePetWithHttpInfo($body) * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetAsync($body) @@ -1533,6 +1561,7 @@ function ($response) { * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetAsyncWithHttpInfo($body) @@ -1575,6 +1604,7 @@ function ($exception) { * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function updatePetRequest($body) @@ -1682,8 +1712,9 @@ protected function updatePetRequest($body) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function updatePetWithForm($pet_id, $name = null, $status = null) @@ -1700,8 +1731,9 @@ public function updatePetWithForm($pet_id, $name = null, $status = null) * @param string $name Updated name of the pet (optional) * @param string $status Updated status of the pet (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) @@ -1760,6 +1792,7 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n * @param string $status Updated status of the pet (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetWithFormAsync($pet_id, $name = null, $status = null) @@ -1782,6 +1815,7 @@ function ($response) { * @param string $status Updated status of the pet (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null) @@ -1826,6 +1860,7 @@ function ($exception) { * @param string $status Updated status of the pet (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function updatePetWithFormRequest($pet_id, $name = null, $status = null) @@ -1946,8 +1981,9 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\ApiResponse */ public function uploadFile($pet_id, $additional_metadata = null, $file = null) @@ -1965,8 +2001,9 @@ public function uploadFile($pet_id, $additional_metadata = null, $file = null) * @param string $additional_metadata Additional data to pass to server (optional) * @param \SplFileObject $file file to upload (optional) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) @@ -2047,6 +2084,7 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi * @param \SplFileObject $file file to upload (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) @@ -2069,6 +2107,7 @@ function ($response) { * @param \SplFileObject $file file to upload (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null) @@ -2127,6 +2166,7 @@ function ($exception) { * @param \SplFileObject $file file to upload (optional) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index a5989679100..91b30a9ec43 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -95,8 +95,9 @@ public function getConfig() * * @param string $order_id ID of the order that needs to be deleted (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function deleteOrder($order_id) @@ -111,8 +112,9 @@ public function deleteOrder($order_id) * * @param string $order_id ID of the order that needs to be deleted (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function deleteOrderWithHttpInfo($order_id) @@ -169,6 +171,7 @@ public function deleteOrderWithHttpInfo($order_id) * @param string $order_id ID of the order that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteOrderAsync($order_id) @@ -189,6 +192,7 @@ function ($response) { * @param string $order_id ID of the order that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteOrderAsyncWithHttpInfo($order_id) @@ -231,6 +235,7 @@ function ($exception) { * @param string $order_id ID of the order that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function deleteOrderRequest($order_id) @@ -336,8 +341,9 @@ protected function deleteOrderRequest($order_id) * Returns pet inventories by status * * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return map[string,int] */ public function getInventory() @@ -352,8 +358,9 @@ public function getInventory() * Returns pet inventories by status * * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of map[string,int], HTTP status code, HTTP response headers (array of strings) */ public function getInventoryWithHttpInfo() @@ -431,6 +438,7 @@ public function getInventoryWithHttpInfo() * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getInventoryAsync() @@ -450,6 +458,7 @@ function ($response) { * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getInventoryAsyncWithHttpInfo() @@ -505,6 +514,7 @@ function ($exception) { * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function getInventoryRequest() @@ -602,8 +612,9 @@ protected function getInventoryRequest() * * @param int $order_id ID of pet that needs to be fetched (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Order */ public function getOrderById($order_id) @@ -619,8 +630,9 @@ public function getOrderById($order_id) * * @param int $order_id ID of pet that needs to be fetched (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) */ public function getOrderByIdWithHttpInfo($order_id) @@ -699,6 +711,7 @@ public function getOrderByIdWithHttpInfo($order_id) * @param int $order_id ID of pet that needs to be fetched (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getOrderByIdAsync($order_id) @@ -719,6 +732,7 @@ function ($response) { * @param int $order_id ID of pet that needs to be fetched (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getOrderByIdAsyncWithHttpInfo($order_id) @@ -775,6 +789,7 @@ function ($exception) { * @param int $order_id ID of pet that needs to be fetched (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function getOrderByIdRequest($order_id) @@ -888,8 +903,9 @@ protected function getOrderByIdRequest($order_id) * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\Order */ public function placeOrder($body) @@ -905,8 +921,9 @@ public function placeOrder($body) * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\Order, HTTP status code, HTTP response headers (array of strings) */ public function placeOrderWithHttpInfo($body) @@ -985,6 +1002,7 @@ public function placeOrderWithHttpInfo($body) * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function placeOrderAsync($body) @@ -1005,6 +1023,7 @@ function ($response) { * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function placeOrderAsyncWithHttpInfo($body) @@ -1061,6 +1080,7 @@ function ($exception) { * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function placeOrderRequest($body) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 11d3e7a315a..6d8ce3a1bd7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -95,8 +95,9 @@ public function getConfig() * * @param \Swagger\Client\Model\User $body Created user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function createUser($body) @@ -111,8 +112,9 @@ public function createUser($body) * * @param \Swagger\Client\Model\User $body Created user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function createUserWithHttpInfo($body) @@ -169,6 +171,7 @@ public function createUserWithHttpInfo($body) * @param \Swagger\Client\Model\User $body Created user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUserAsync($body) @@ -189,6 +192,7 @@ function ($response) { * @param \Swagger\Client\Model\User $body Created user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUserAsyncWithHttpInfo($body) @@ -231,6 +235,7 @@ function ($exception) { * @param \Swagger\Client\Model\User $body Created user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function createUserRequest($body) @@ -332,8 +337,9 @@ protected function createUserRequest($body) * * @param \Swagger\Client\Model\User[] $body List of user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function createUsersWithArrayInput($body) @@ -348,8 +354,9 @@ public function createUsersWithArrayInput($body) * * @param \Swagger\Client\Model\User[] $body List of user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function createUsersWithArrayInputWithHttpInfo($body) @@ -406,6 +413,7 @@ public function createUsersWithArrayInputWithHttpInfo($body) * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithArrayInputAsync($body) @@ -426,6 +434,7 @@ function ($response) { * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithArrayInputAsyncWithHttpInfo($body) @@ -468,6 +477,7 @@ function ($exception) { * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function createUsersWithArrayInputRequest($body) @@ -569,8 +579,9 @@ protected function createUsersWithArrayInputRequest($body) * * @param \Swagger\Client\Model\User[] $body List of user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function createUsersWithListInput($body) @@ -585,8 +596,9 @@ public function createUsersWithListInput($body) * * @param \Swagger\Client\Model\User[] $body List of user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function createUsersWithListInputWithHttpInfo($body) @@ -643,6 +655,7 @@ public function createUsersWithListInputWithHttpInfo($body) * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithListInputAsync($body) @@ -663,6 +676,7 @@ function ($response) { * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function createUsersWithListInputAsyncWithHttpInfo($body) @@ -705,6 +719,7 @@ function ($exception) { * @param \Swagger\Client\Model\User[] $body List of user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function createUsersWithListInputRequest($body) @@ -806,8 +821,9 @@ protected function createUsersWithListInputRequest($body) * * @param string $username The name that needs to be deleted (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function deleteUser($username) @@ -822,8 +838,9 @@ public function deleteUser($username) * * @param string $username The name that needs to be deleted (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function deleteUserWithHttpInfo($username) @@ -880,6 +897,7 @@ public function deleteUserWithHttpInfo($username) * @param string $username The name that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteUserAsync($username) @@ -900,6 +918,7 @@ function ($response) { * @param string $username The name that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function deleteUserAsyncWithHttpInfo($username) @@ -942,6 +961,7 @@ function ($exception) { * @param string $username The name that needs to be deleted (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function deleteUserRequest($username) @@ -1048,8 +1068,9 @@ protected function deleteUserRequest($username) * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return \Swagger\Client\Model\User */ public function getUserByName($username) @@ -1065,8 +1086,9 @@ public function getUserByName($username) * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings) */ public function getUserByNameWithHttpInfo($username) @@ -1145,6 +1167,7 @@ public function getUserByNameWithHttpInfo($username) * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getUserByNameAsync($username) @@ -1165,6 +1188,7 @@ function ($response) { * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function getUserByNameAsyncWithHttpInfo($username) @@ -1221,6 +1245,7 @@ function ($exception) { * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function getUserByNameRequest($username) @@ -1328,8 +1353,9 @@ protected function getUserByNameRequest($username) * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return string */ public function loginUser($username, $password) @@ -1346,8 +1372,9 @@ public function loginUser($username, $password) * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of string, HTTP status code, HTTP response headers (array of strings) */ public function loginUserWithHttpInfo($username, $password) @@ -1427,6 +1454,7 @@ public function loginUserWithHttpInfo($username, $password) * @param string $password The password for login in clear text (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function loginUserAsync($username, $password) @@ -1448,6 +1476,7 @@ function ($response) { * @param string $password The password for login in clear text (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function loginUserAsyncWithHttpInfo($username, $password) @@ -1505,6 +1534,7 @@ function ($exception) { * @param string $password The password for login in clear text (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function loginUserRequest($username, $password) @@ -1616,8 +1646,9 @@ protected function loginUserRequest($username, $password) * Logs out current logged in user session * * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function logoutUser() @@ -1631,8 +1662,9 @@ public function logoutUser() * Logs out current logged in user session * * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function logoutUserWithHttpInfo() @@ -1688,6 +1720,7 @@ public function logoutUserWithHttpInfo() * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function logoutUserAsync() @@ -1707,6 +1740,7 @@ function ($response) { * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function logoutUserAsyncWithHttpInfo() @@ -1748,6 +1782,7 @@ function ($exception) { * * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function logoutUserRequest() @@ -1841,8 +1876,9 @@ protected function logoutUserRequest() * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return void */ public function updateUser($username, $body) @@ -1858,8 +1894,9 @@ public function updateUser($username, $body) * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) * - * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \Swagger\Client\ApiException on non-2xx response or a failure without a response * @throws \InvalidArgumentException + * @throws \JsonException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ public function updateUserWithHttpInfo($username, $body) @@ -1917,6 +1954,7 @@ public function updateUserWithHttpInfo($username, $body) * @param \Swagger\Client\Model\User $body Updated user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updateUserAsync($username, $body) @@ -1938,6 +1976,7 @@ function ($response) { * @param \Swagger\Client\Model\User $body Updated user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Promise\PromiseInterface */ public function updateUserAsyncWithHttpInfo($username, $body) @@ -1981,6 +2020,7 @@ function ($exception) { * @param \Swagger\Client\Model\User $body Updated user object (required) * * @throws \InvalidArgumentException + * @throws \JsonException * @return \GuzzleHttp\Psr7\Request */ protected function updateUserRequest($username, $body)