-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP] RFC on emitted code quality #3867
Comments
@dkarlovi thanks for the suggestion. We definitely welcome code analysis/inspection using PHPStorm or other tools (previously I tried codeclimate, codacy). Do you mind sharing the PHPStorm report so that the community can review and comment on it? |
@wing328 not at all, I'll add it here for Petstore later today. |
Here's the inspections' output. Sorry about it being an archive instead of link to a HTML file, it created a 15MB file which I don't know where to host or what to do with. Anyway, not all of these are errors, but I feel there's some good stuff here which can be used. /cc @arnested |
@wing328 just wanted to let you know I didn't forget about this, my Swagger-related commercial project started back up so I will be working on this in the near future for sure. |
@dkarlovi thanks for the update. If you need any help from us (the community), please let us know. (we've just added Swagger Codegen to ProductHunt: https://www.producthunt.com/posts/swagger-codegen, pleae upvote if you find Swagger Codegen useful) |
Using #5277 for tracking and closing this one |
Description
The code emitted by PHP generator is solid, but could be made better. If I open the project with PHPStorm and crank up all the inspections (including the excellent EA extended), I get quite a few violations, including those regarding code style, code smell, performance, type compatibility, etc.
As the code is generated, most of these (almost all of them) could be fixed with rather simple tweaks (some would require a more significant change which might break BC, not sure), we could tweak the templates, much like #3863.
This would make the emitted code read almost as hand-written.
Swagger-codegen version
Latest.
Related issues
#3863 is the first step in this direction. Probably also #1482.
Suggest a Fix
PR fixing this, making emitted code of higher quality and a first step toward maybe replacing the HTTP client.
The text was updated successfully, but these errors were encountered: