[PHP] Refactor php client generator (#504)

* Extends AbstractPhpCodegen instead of DefaultCodegen

* Remove fully duplicated methods with AbstractPhpCodegen

* Remove duplicated properties with AbstractPhpCodegen

* Remove duplicated codes in constructor with AbstractPhpCodegen

* Add typeMapping "date". Moved from PhpClientCodegen

refs: 3c34c0b377 (diff-f1801ef05a7926bf394c90f44ae4ab3dL132)

* Remove duplicated codes in processOpts()

* Remove unnecessary 'implements'

* Remove unnecessary method override

* Use setter

* Merge getTypeDeclaration() into AbstractPhpCodegen

* Merge processOpts() into AbstractPhpCodegen

refs:
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL139)
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL147)
* 296e6d3db4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL153)

* tweak

* Optimize IF statement

* Remove duplicated methods

* Merge setParameterExampleValue() into AbstractPhpCodegen

* Merge toEnumVarName() into AbstractPhpCodegen

* Merge toEnumName() into AbstractPhpCodegen

* Merge escapeUnsafeCharacters() into AbstractPhpCodegen

* Merge postProcessOperationsWithModels() into AbstractPhpCodegen

* tweak

* Recover missing method

refs: 2ad0f6f7d4 (diff-f1801ef05a7926bf394c90f44ae4ab3dL91)

* Tweak test case

refs: 4e7b7afc1a

* Remove unnecessary 'import'

* Update lumen and ze-ph samples

- ./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
- ./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1

* Update slim samples

* Fix script name

* Update silex samples

* Update kotlin-server
This commit is contained in:
Akihito Nakano
2018-07-17 10:27:02 +09:00
committed by William Cheng
parent afb238814d
commit 6d6ef0f120
10 changed files with 60 additions and 653 deletions

View File

@@ -53,7 +53,7 @@ class FakeApi extends Controller
/**
* Operation testEndpointParameters
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
*
*
* @return Http response

View File

@@ -37,8 +37,8 @@ $app->patch('/v2/another-fake/dummy', 'AnotherFakeApi@testSpecialTags');
$app->patch('/v2/fake', 'FakeApi@testClientModel');
/**
* post testEndpointParameters
* Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*/
$app->post('/v2/fake', 'FakeApi@testEndpointParameters');