-
Notifications
You must be signed in to change notification settings - Fork 6k
[PHP] Remove unnecessary call to setHost() in the constructor #4525
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] Remove unnecessary call to setHost() in the constructor #4525
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.