[PHP] Remove unnecessary call to setHost() in the constructor#4525
[PHP] Remove unnecessary call to setHost() in the constructor#4525wing328 merged 4 commits intoswagger-api:masterfrom
Conversation
The default host will be automatically set on the client by the ApiClient constructor.
|
@toomuchpete thanks for the PR. Please also run |
|
@toomuchpete you may also want to add test case(s) to cover the issue moving forward: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/php/SwaggerClient-php/tests |
|
cc @arnested |
…ger-api#4525, but seem to have not been included yet.
|
Hi @wing328, thanks for the feedback! I didn't include the petstore updates because they appeared to include more changes than just mine so I thought I might be doing the wrong thing. I've pushed those changes up in two separate commits. The first contains the changes I expected to see, and the second has changes that, I think, are left over from other code changes. I'll look into adding a test for this situation this week. Thank you for your patience with my first contribution. 😄 |
|
@toomuchpete your first PR definitely looks good 👍 Please take your time and let us know if you need any help from us. |
…ger-api#4525, but seem to have not been included yet.
20e0996 to
96665de
Compare
|
Hello again, @wing328 -- happy to report that I added a test for this situation. I wasn't sure exactly where to put it, but the Let me know if there's anything else I can do to get this PR ready to be merged! |
|
@toomuchpete the PR with test cases look good to me. Thanks for your contribution 👍 |
|
@wing328 @toomuchpete Looks good. I filed the same bug with a different PR, but your change is simpler and much preferred. FWIW, it was Issue #4540 and PR #4518. I tested your change and it works great. You even added a test case, what a good model citizen! :) I also ran into the creating unrelated To summarize: now we can set host at runtime by either editing |
…4525) * Remove unnecessary call to setHost() in the constructor The default host will be automatically set on the client by the ApiClient constructor. * Updated PHP API Classes corresponding to template updates in swagger-api#4525. * Additional changes generated by the petstore update unrelated to swagger-api#4525, but seem to have not been included yet. * Add test to prevent regressions of swagger-api#4525
The default host will be automatically set on the client by the ApiClient constructor.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
As reported in #4511, Calling
setHost()is unnecessary because ApiClient() constructor configures itself based on the default. This PR simply removes that line.Resulting clients should be equivalent at runtime.