Commit 6d6ef0f
[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: 3c34c0b#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:
* 296e6d3#diff-f1801ef05a7926bf394c90f44ae4ab3dL139
* 296e6d3#diff-f1801ef05a7926bf394c90f44ae4ab3dL147
* 296e6d3#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: 2ad0f6f#diff-f1801ef05a7926bf394c90f44ae4ab3dL91
* Tweak test case
refs: 4e7b7af
* 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-server1 parent afb2388 commit 6d6ef0f
10 files changed
Lines changed: 60 additions & 653 deletions
File tree
- bin/utils
- modules/openapi-generator/src
- main/java/org/openapitools/codegen/languages
- test/java/org/openapitools/codegen/php
- samples/server/petstore
- php-lumen/lib/app/Http
- Controllers
- php-slim/lib
- Api
- Model
- php-ze-ph/src/App
- DTO
- Handler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
Lines changed: 41 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
177 | | - | |
178 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
179 | 185 | | |
| 186 | + | |
180 | 187 | | |
181 | | - | |
182 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
183 | 191 | | |
| 192 | + | |
184 | 193 | | |
185 | 194 | | |
186 | 195 | | |
| |||
329 | 338 | | |
330 | 339 | | |
331 | 340 | | |
332 | | - | |
| 341 | + | |
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
| |||
542 | 551 | | |
543 | 552 | | |
544 | 553 | | |
545 | | - | |
| 554 | + | |
546 | 555 | | |
547 | | - | |
| 556 | + | |
548 | 557 | | |
549 | | - | |
| 558 | + | |
550 | 559 | | |
551 | 560 | | |
552 | 561 | | |
| |||
559 | 568 | | |
560 | 569 | | |
561 | 570 | | |
562 | | - | |
| 571 | + | |
563 | 572 | | |
564 | | - | |
| 573 | + | |
565 | 574 | | |
566 | 575 | | |
567 | | - | |
| 576 | + | |
568 | 577 | | |
569 | 578 | | |
570 | 579 | | |
571 | 580 | | |
572 | | - | |
| 581 | + | |
573 | 582 | | |
574 | 583 | | |
575 | 584 | | |
576 | 585 | | |
| 586 | + | |
| 587 | + | |
577 | 588 | | |
578 | 589 | | |
579 | 590 | | |
| |||
631 | 642 | | |
632 | 643 | | |
633 | 644 | | |
634 | | - | |
635 | | - | |
| 645 | + | |
| 646 | + | |
636 | 647 | | |
637 | 648 | | |
638 | 649 | | |
| |||
642 | 653 | | |
643 | 654 | | |
644 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
645 | 659 | | |
646 | 660 | | |
647 | 661 | | |
| |||
660 | 674 | | |
661 | 675 | | |
662 | 676 | | |
| 677 | + | |
| 678 | + | |
663 | 679 | | |
664 | 680 | | |
665 | 681 | | |
| |||
673 | 689 | | |
674 | 690 | | |
675 | 691 | | |
676 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
677 | 703 | | |
678 | 704 | | |
679 | 705 | | |
| |||
0 commit comments