From e2b8e4308f3d23c8501a3496459652a1811cf362 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 24 Jun 2020 10:19:20 +0300 Subject: [PATCH 1/4] Bump required PHP version to ^7.2 --- .../src/main/resources/php-ze-ph/composer.json.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/php-ze-ph/composer.json.mustache b/modules/openapi-generator/src/main/resources/php-ze-ph/composer.json.mustache index c603ff4ac436..8306bc621e18 100644 --- a/modules/openapi-generator/src/main/resources/php-ze-ph/composer.json.mustache +++ b/modules/openapi-generator/src/main/resources/php-ze-ph/composer.json.mustache @@ -5,7 +5,7 @@ "version": "{{artifactVersion}}", "type": "project", "require": { - "php": "^7.1", + "php": "^7.2", "ext-yaml": "^2.0", "zendframework/zend-expressive": "^3.2", "zendframework/zend-diactoros": "^2.1", From 94a1b7c51dc63cfb067312026574284f86bb3ecf Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 24 Jun 2020 10:20:46 +0300 Subject: [PATCH 2/4] Update required PHP version in readme --- .../src/main/resources/php-ze-ph/README.md.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/php-ze-ph/README.md.mustache b/modules/openapi-generator/src/main/resources/php-ze-ph/README.md.mustache index 973240bb44ed..1cc1e36e9c29 100644 --- a/modules/openapi-generator/src/main/resources/php-ze-ph/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/php-ze-ph/README.md.mustache @@ -5,7 +5,7 @@ Generated by the [OpenAPI Generator](https://openapi-generator.tech) project. ## Overview This server stub aims to provide light, yet comprehensive structure for your API project using: -- PHP: >=7.1 +- PHP: >=7.2 - [Zend Expressive](https://zendframework.github.io/zend-expressive): >=3.2 - [Path Handler](https://github.com/Articus/PathHandler): >=0.4 From 3127f0fb5e1136a60a3248acbab774546cad29a1 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 24 Jun 2020 10:22:25 +0300 Subject: [PATCH 3/4] Change samples input spec to OAS 3.0 --- bin/configs/php-ze-ph.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/configs/php-ze-ph.yaml b/bin/configs/php-ze-ph.yaml index b3416dc196be..009f17a0e432 100644 --- a/bin/configs/php-ze-ph.yaml +++ b/bin/configs/php-ze-ph.yaml @@ -1,4 +1,4 @@ generatorName: php-ze-ph outputDir: samples/server/petstore/php-ze-ph -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/php-ze-ph From 390dc8b9cfe0003b10f83b99cabc2d989389b93d Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 24 Jun 2020 10:25:44 +0300 Subject: [PATCH 4/4] Refresh samples --- .../php-ze-ph/.openapi-generator/FILES | 59 +---- samples/server/petstore/php-ze-ph/README.md | 2 +- .../application/config/path_handler.yml | 28 --- .../server/petstore/php-ze-ph/composer.json | 2 +- .../App/DTO/AdditionalPropertiesAnyType.php | 18 -- .../src/App/DTO/AdditionalPropertiesArray.php | 18 -- .../App/DTO/AdditionalPropertiesBoolean.php | 18 -- .../src/App/DTO/AdditionalPropertiesClass.php | 106 --------- .../App/DTO/AdditionalPropertiesInteger.php | 18 -- .../App/DTO/AdditionalPropertiesNumber.php | 18 -- .../App/DTO/AdditionalPropertiesObject.php | 18 -- .../App/DTO/AdditionalPropertiesString.php | 18 -- .../php-ze-ph/src/App/DTO/ApiResponse.php | 1 + .../src/App/DTO/ArrayOfArrayOfNumberOnly.php | 22 -- .../src/App/DTO/ArrayOfNumberOnly.php | 21 -- .../php-ze-ph/src/App/DTO/ArrayTest.php | 41 ---- .../petstore/php-ze-ph/src/App/DTO/BigCat.php | 36 --- .../php-ze-ph/src/App/DTO/BigCatAllOf.php | 18 -- .../php-ze-ph/src/App/DTO/Capitalization.php | 49 ---- .../petstore/php-ze-ph/src/App/DTO/Cat.php | 30 --- .../php-ze-ph/src/App/DTO/CatAllOf.php | 18 -- .../php-ze-ph/src/App/DTO/Category.php | 4 +- .../php-ze-ph/src/App/DTO/ClassModel.php | 19 -- .../petstore/php-ze-ph/src/App/DTO/Client.php | 18 -- .../petstore/php-ze-ph/src/App/DTO/Dog.php | 30 --- .../php-ze-ph/src/App/DTO/DogAllOf.php | 18 -- .../php-ze-ph/src/App/DTO/EnumArrays.php | 27 --- .../php-ze-ph/src/App/DTO/EnumClass.php | 12 - .../php-ze-ph/src/App/DTO/EnumTest.php | 43 ---- .../src/App/DTO/FileSchemaTestClass.php | 29 --- .../src/App/DTO/FindPetsByStatusQueryData.php | 22 ++ .../src/App/DTO/FindPetsByTagsQueryData.php | 22 ++ .../php-ze-ph/src/App/DTO/FormatTest.php | 113 ---------- .../php-ze-ph/src/App/DTO/HasOnlyReadOnly.php | 24 -- .../App/DTO/{Animal.php => InlineObject.php} | 12 +- .../php-ze-ph/src/App/DTO/InlineObject1.php | 27 +++ .../src/App/DTO/LoginUserQueryData.php | 30 +++ .../php-ze-ph/src/App/DTO/MapTest.php | 49 ---- ...PropertiesAndAdditionalPropertiesClass.php | 35 --- .../src/App/DTO/Model200Response.php | 25 -- .../php-ze-ph/src/App/DTO/ModelReturn.php | 19 -- .../petstore/php-ze-ph/src/App/DTO/Name.php | 37 --- .../php-ze-ph/src/App/DTO/NumberOnly.php | 18 -- .../petstore/php-ze-ph/src/App/DTO/Order.php | 1 + .../php-ze-ph/src/App/DTO/OuterComposite.php | 30 --- .../php-ze-ph/src/App/DTO/OuterEnum.php | 12 - .../petstore/php-ze-ph/src/App/DTO/Pet.php | 1 + .../php-ze-ph/src/App/DTO/ReadOnlyFirst.php | 24 -- .../src/App/DTO/SpecialModelName.php | 18 -- .../petstore/php-ze-ph/src/App/DTO/Tag.php | 1 + .../src/App/DTO/TypeHolderDefault.php | 45 ---- .../src/App/DTO/TypeHolderExample.php | 51 ----- .../petstore/php-ze-ph/src/App/DTO/User.php | 1 + .../php-ze-ph/src/App/DTO/XmlItem.php | 213 ------------------ .../php-ze-ph/src/App/ErrorMiddleware.php | 34 --- .../src/App/Handler/AnotherFakeDummy.php | 39 ---- .../php-ze-ph/src/App/Handler/Fake.php | 75 ------ .../App/Handler/FakeBodyWithFileSchema.php | 34 --- .../App/Handler/FakeBodyWithQueryParams.php | 34 --- .../src/App/Handler/FakeClassnameTest.php | 39 ---- .../src/App/Handler/FakeCreateXmlItem.php | 45 ---- .../FakeInlineAdditionalProperties.php | 36 --- .../src/App/Handler/FakeJsonFormData.php | 30 --- .../src/App/Handler/FakeOuterBoolean.php | 33 --- .../src/App/Handler/FakeOuterComposite.php | 36 --- .../src/App/Handler/FakeOuterNumber.php | 33 --- .../src/App/Handler/FakeOuterString.php | 33 --- .../FakePetIdUploadImageWithRequiredFile.php | 34 --- .../App/Handler/FakeTestQueryParamters.php | 29 --- .../php-ze-ph/src/App/Handler/Pet.php | 16 +- .../src/App/Handler/PetFindByStatus.php | 7 + .../src/App/Handler/PetFindByTags.php | 7 + .../php-ze-ph/src/App/Handler/StoreOrder.php | 2 + .../src/App/Handler/StoreOrderOrderId.php | 2 +- .../php-ze-ph/src/App/Handler/User.php | 2 + .../src/App/Handler/UserCreateWithArray.php | 2 + .../src/App/Handler/UserCreateWithList.php | 2 + .../php-ze-ph/src/App/Handler/UserLogin.php | 7 + .../src/App/Handler/UserUsername.php | 2 + 79 files changed, 169 insertions(+), 2033 deletions(-) delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesAnyType.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesArray.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesBoolean.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesClass.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesInteger.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesNumber.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesObject.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesString.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ArrayOfArrayOfNumberOnly.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ArrayOfNumberOnly.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ArrayTest.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/BigCat.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/BigCatAllOf.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Capitalization.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Cat.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/CatAllOf.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ClassModel.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Client.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Dog.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/DogAllOf.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/EnumArrays.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/EnumClass.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/EnumTest.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/FileSchemaTestClass.php create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/FindPetsByStatusQueryData.php create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/FindPetsByTagsQueryData.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/FormatTest.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/HasOnlyReadOnly.php rename samples/server/petstore/php-ze-ph/src/App/DTO/{Animal.php => InlineObject.php} (58%) create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/InlineObject1.php create mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/LoginUserQueryData.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/MapTest.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Model200Response.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ModelReturn.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/Name.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/NumberOnly.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/OuterComposite.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/OuterEnum.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/ReadOnlyFirst.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/SpecialModelName.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderDefault.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/TypeHolderExample.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/DTO/XmlItem.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/ErrorMiddleware.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/AnotherFakeDummy.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/Fake.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithFileSchema.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithQueryParams.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeClassnameTest.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeCreateXmlItem.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeInlineAdditionalProperties.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeJsonFormData.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterBoolean.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterComposite.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterNumber.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterString.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakePetIdUploadImageWithRequiredFile.php delete mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/FILES b/samples/server/petstore/php-ze-ph/.openapi-generator/FILES index ea6de5a097c9..d2b3e5a4d233 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/FILES +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/FILES @@ -7,67 +7,18 @@ application/config/path_handler.yml application/container.php composer.json public/index.php -src/App/DTO/AdditionalPropertiesAnyType.php -src/App/DTO/AdditionalPropertiesArray.php -src/App/DTO/AdditionalPropertiesBoolean.php -src/App/DTO/AdditionalPropertiesClass.php -src/App/DTO/AdditionalPropertiesInteger.php -src/App/DTO/AdditionalPropertiesNumber.php -src/App/DTO/AdditionalPropertiesObject.php -src/App/DTO/AdditionalPropertiesString.php -src/App/DTO/Animal.php src/App/DTO/ApiResponse.php -src/App/DTO/ArrayOfArrayOfNumberOnly.php -src/App/DTO/ArrayOfNumberOnly.php -src/App/DTO/ArrayTest.php -src/App/DTO/BigCat.php -src/App/DTO/BigCatAllOf.php -src/App/DTO/Capitalization.php -src/App/DTO/Cat.php -src/App/DTO/CatAllOf.php src/App/DTO/Category.php -src/App/DTO/ClassModel.php -src/App/DTO/Client.php -src/App/DTO/Dog.php -src/App/DTO/DogAllOf.php -src/App/DTO/EnumArrays.php -src/App/DTO/EnumClass.php -src/App/DTO/EnumTest.php -src/App/DTO/FileSchemaTestClass.php -src/App/DTO/FormatTest.php -src/App/DTO/HasOnlyReadOnly.php -src/App/DTO/MapTest.php -src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php -src/App/DTO/Model200Response.php -src/App/DTO/ModelReturn.php -src/App/DTO/Name.php -src/App/DTO/NumberOnly.php +src/App/DTO/FindPetsByStatusQueryData.php +src/App/DTO/FindPetsByTagsQueryData.php +src/App/DTO/InlineObject.php +src/App/DTO/InlineObject1.php +src/App/DTO/LoginUserQueryData.php src/App/DTO/Order.php -src/App/DTO/OuterComposite.php -src/App/DTO/OuterEnum.php src/App/DTO/Pet.php -src/App/DTO/ReadOnlyFirst.php -src/App/DTO/SpecialModelName.php src/App/DTO/Tag.php -src/App/DTO/TypeHolderDefault.php -src/App/DTO/TypeHolderExample.php src/App/DTO/User.php -src/App/DTO/XmlItem.php src/App/Factory.php -src/App/Handler/AnotherFakeDummy.php -src/App/Handler/Fake.php -src/App/Handler/FakeBodyWithFileSchema.php -src/App/Handler/FakeBodyWithQueryParams.php -src/App/Handler/FakeClassnameTest.php -src/App/Handler/FakeCreateXmlItem.php -src/App/Handler/FakeInlineAdditionalProperties.php -src/App/Handler/FakeJsonFormData.php -src/App/Handler/FakeOuterBoolean.php -src/App/Handler/FakeOuterComposite.php -src/App/Handler/FakeOuterNumber.php -src/App/Handler/FakeOuterString.php -src/App/Handler/FakePetIdUploadImageWithRequiredFile.php -src/App/Handler/FakeTestQueryParamters.php src/App/Handler/Pet.php src/App/Handler/PetFindByStatus.php src/App/Handler/PetFindByTags.php diff --git a/samples/server/petstore/php-ze-ph/README.md b/samples/server/petstore/php-ze-ph/README.md index 973240bb44ed..1cc1e36e9c29 100644 --- a/samples/server/petstore/php-ze-ph/README.md +++ b/samples/server/petstore/php-ze-ph/README.md @@ -5,7 +5,7 @@ Generated by the [OpenAPI Generator](https://openapi-generator.tech) project. ## Overview This server stub aims to provide light, yet comprehensive structure for your API project using: -- PHP: >=7.1 +- PHP: >=7.2 - [Zend Expressive](https://zendframework.github.io/zend-expressive): >=3.2 - [Path Handler](https://github.com/Articus/PathHandler): >=0.4 diff --git a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml index 786a0330ced8..08762d5415aa 100644 --- a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml +++ b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml @@ -1,20 +1,6 @@ Articus\PathHandler\RouteInjection\Factory: paths: '/v2': - - App\Handler\AnotherFakeDummy - - App\Handler\Fake - - App\Handler\FakeBodyWithFileSchema - - App\Handler\FakeBodyWithQueryParams - - App\Handler\FakeCreateXmlItem - - App\Handler\FakeInlineAdditionalProperties - - App\Handler\FakeJsonFormData - - App\Handler\FakeOuterBoolean - - App\Handler\FakeOuterComposite - - App\Handler\FakeOuterNumber - - App\Handler\FakeOuterString - - App\Handler\FakeTestQueryParamters - - App\Handler\FakePetIdUploadImageWithRequiredFile - - App\Handler\FakeClassnameTest - App\Handler\Pet - App\Handler\PetFindByStatus - App\Handler\PetFindByTags @@ -43,20 +29,6 @@ Articus\PathHandler\RouteInjection\Factory: # invokables: Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory: - App\Handler\AnotherFakeDummy: [] - App\Handler\Fake: [] - App\Handler\FakeBodyWithFileSchema: [] - App\Handler\FakeBodyWithQueryParams: [] - App\Handler\FakeCreateXmlItem: [] - App\Handler\FakeInlineAdditionalProperties: [] - App\Handler\FakeJsonFormData: [] - App\Handler\FakeOuterBoolean: [] - App\Handler\FakeOuterComposite: [] - App\Handler\FakeOuterNumber: [] - App\Handler\FakeOuterString: [] - App\Handler\FakeTestQueryParamters: [] - App\Handler\FakePetIdUploadImageWithRequiredFile: [] - App\Handler\FakeClassnameTest: [] App\Handler\Pet: [] App\Handler\PetFindByStatus: [] App\Handler\PetFindByTags: [] diff --git a/samples/server/petstore/php-ze-ph/composer.json b/samples/server/petstore/php-ze-ph/composer.json index 99c78857b2f3..f22fd4929557 100644 --- a/samples/server/petstore/php-ze-ph/composer.json +++ b/samples/server/petstore/php-ze-ph/composer.json @@ -5,7 +5,7 @@ "version": "1.0.0", "type": "project", "require": { - "php": "^7.1", + "php": "^7.2", "ext-yaml": "^2.0", "zendframework/zend-expressive": "^3.2", "zendframework/zend-diactoros": "^2.1", diff --git a/samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesAnyType.php b/samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesAnyType.php deleted file mode 100644 index 0cce3aa9a5f3..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/DTO/AdditionalPropertiesAnyType.php +++ /dev/null @@ -1,18 +0,0 @@ -process($request); - ErrorHandler::stop(true); - if (!($result instanceof Response)) { - throw new \RuntimeException(sprintf( - 'Invalid response: expecting %s, got %s', - Response::class, - is_object($result)? get_class($result) : gettype($result) - )); - } - } - catch (\Exception $error) { - $result = (new \Zend\Diactoros\Response())->withStatus(500, 'Internal server error'); - error_log((string)$error); - } - return $result; - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/AnotherFakeDummy.php b/samples/server/petstore/php-ze-ph/src/App/Handler/AnotherFakeDummy.php deleted file mode 100644 index ee20ba08d24a..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/AnotherFakeDummy.php +++ /dev/null @@ -1,39 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/Fake.php b/samples/server/petstore/php-ze-ph/src/App/Handler/Fake.php deleted file mode 100644 index 76880c68f6da..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/Fake.php +++ /dev/null @@ -1,75 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @PHA\Post() - * @param ServerRequestInterface $request - * - * @throws PHException\HttpCode 501 if the method is not implemented - */ - public function testEndpointParameters(ServerRequestInterface $request) - { - //TODO implement method - throw new PHException\HttpCode(501, "Not implemented"); - } - /** - * To test enum parameters - * @PHA\Get() - * @param ServerRequestInterface $request - * - * @throws PHException\HttpCode 501 if the method is not implemented - */ - public function testEnumParameters(ServerRequestInterface $request) - { - //TODO implement method - throw new PHException\HttpCode(501, "Not implemented"); - } - /** - * Fake endpoint to test group parameters (optional) - * @PHA\Delete() - * @param ServerRequestInterface $request - * - * @throws PHException\HttpCode 501 if the method is not implemented - */ - public function testGroupParameters(ServerRequestInterface $request) - { - //TODO implement method - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithFileSchema.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithFileSchema.php deleted file mode 100644 index 47ce029df6e1..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithFileSchema.php +++ /dev/null @@ -1,34 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithQueryParams.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithQueryParams.php deleted file mode 100644 index 9844c5978164..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeBodyWithQueryParams.php +++ /dev/null @@ -1,34 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeClassnameTest.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeClassnameTest.php deleted file mode 100644 index 74991195dce0..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeClassnameTest.php +++ /dev/null @@ -1,39 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeCreateXmlItem.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeCreateXmlItem.php deleted file mode 100644 index ec96b29c8ef0..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeCreateXmlItem.php +++ /dev/null @@ -1,45 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeInlineAdditionalProperties.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeInlineAdditionalProperties.php deleted file mode 100644 index bb6868c68e3e..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeInlineAdditionalProperties.php +++ /dev/null @@ -1,36 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeJsonFormData.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeJsonFormData.php deleted file mode 100644 index ed3e0f6d2efe..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeJsonFormData.php +++ /dev/null @@ -1,30 +0,0 @@ -getAttribute("bodyData"); - throw new PHException\HttpCode(501, "Not implemented"); - } -} diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterNumber.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterNumber.php deleted file mode 100644 index 595690de8977..000000000000 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeOuterNumber.php +++ /dev/null @@ -1,33 +0,0 @@ -getAttribute("queryData"); throw new PHException\HttpCode(501, "Not implemented"); } } diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/PetFindByTags.php b/samples/server/petstore/php-ze-ph/src/App/Handler/PetFindByTags.php index 0126ada37c0a..b722a310efb0 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/PetFindByTags.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/PetFindByTags.php @@ -18,6 +18,11 @@ class PetFindByTags /** * Finds Pets by tags * @PHA\Get() + * @PHA\Attribute(name=PHAttribute\Transfer::class, options={ + * "type":\App\DTO\FindPetsByTagsQueryData::class, + * "objectAttr":"queryData", + * "source": PHAttribute\Transfer::SOURCE_GET + * }) * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml") * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation @@ -32,6 +37,8 @@ class PetFindByTags public function findPetsByTags(ServerRequestInterface $request): array { //TODO implement method + /** @var \App\DTO\FindPetsByTagsQueryData $queryData */ + $queryData = $request->getAttribute("queryData"); throw new PHException\HttpCode(501, "Not implemented"); } } diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrder.php b/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrder.php index 23623764409a..567e312fea5a 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrder.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrder.php @@ -18,6 +18,8 @@ class StoreOrder /** * Place an order for a pet * @PHA\Post() + * TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation + * @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json") * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\Order::class,"objectAttr":"bodyData"}) * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml") diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrderOrderId.php b/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrderOrderId.php index 28aa169a0c89..31c53e597eb3 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrderOrderId.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/StoreOrderOrderId.php @@ -11,7 +11,7 @@ use Psr\Http\Message\ServerRequestInterface; /** - * @PHA\Route(pattern="/store/order/{order_id}") + * @PHA\Route(pattern="/store/order/{orderId}") */ class StoreOrderOrderId { diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/User.php b/samples/server/petstore/php-ze-ph/src/App/Handler/User.php index 9d3d8ceb9e37..db151a05c60a 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/User.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/User.php @@ -18,6 +18,8 @@ class User /** * Create user * @PHA\Post() + * TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation + * @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json") * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\User::class,"objectAttr":"bodyData"}) * @param ServerRequestInterface $request * diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithArray.php b/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithArray.php index 8ac24b28f2f6..4a2204fb7c0d 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithArray.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithArray.php @@ -18,6 +18,8 @@ class UserCreateWithArray /** * Creates list of users with given input array * @PHA\Post() + * TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation + * @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json") * TODO check if attribute is valid and can handle your container type * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":"\App\DTO\User[]","objectAttr":"bodyData"}) * @param ServerRequestInterface $request diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithList.php b/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithList.php index 27ccafbb5d22..f61d9e4061eb 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithList.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/UserCreateWithList.php @@ -18,6 +18,8 @@ class UserCreateWithList /** * Creates list of users with given input array * @PHA\Post() + * TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation + * @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json") * TODO check if attribute is valid and can handle your container type * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":"\App\DTO\User[]","objectAttr":"bodyData"}) * @param ServerRequestInterface $request diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/UserLogin.php b/samples/server/petstore/php-ze-ph/src/App/Handler/UserLogin.php index 2322e8f2317f..577e7c3f5629 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/UserLogin.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/UserLogin.php @@ -18,6 +18,11 @@ class UserLogin /** * Logs user into the system * @PHA\Get() + * @PHA\Attribute(name=PHAttribute\Transfer::class, options={ + * "type":\App\DTO\LoginUserQueryData::class, + * "objectAttr":"queryData", + * "source": PHAttribute\Transfer::SOURCE_GET + * }) * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation * @PHA\Producer(name=PHProducer\Transfer::class, mediaType="application/xml") * TODO check if producer is valid, if it has correct priority and if it can be moved to class annotation @@ -31,6 +36,8 @@ class UserLogin public function loginUser(ServerRequestInterface $request): string { //TODO implement method + /** @var \App\DTO\LoginUserQueryData $queryData */ + $queryData = $request->getAttribute("queryData"); throw new PHException\HttpCode(501, "Not implemented"); } } diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/UserUsername.php b/samples/server/petstore/php-ze-ph/src/App/Handler/UserUsername.php index 290bfeb9731d..1888015fea9b 100644 --- a/samples/server/petstore/php-ze-ph/src/App/Handler/UserUsername.php +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/UserUsername.php @@ -48,6 +48,8 @@ public function getUserByName(ServerRequestInterface $request): \App\DTO\User /** * Updated user * @PHA\Put() + * TODO check if consumer is valid, if it has correct priority and if it can be moved to class annotation + * @PHA\Consumer(name=PHConsumer\Json::class, mediaType="application/json") * @PHA\Attribute(name=PHAttribute\Transfer::class, options={"type":\App\DTO\User::class,"objectAttr":"bodyData"}) * @param ServerRequestInterface $request *