[PHP] Separate `host` accessor into some parts
PR checklist
- [x] Read the contribution guidelines.
- [x] Ran the shell script under
./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). Windows batch files can be found in.\bin\windows\. - [x] Filed the PR against the correct branch:
3.0.0branch for changes related to OpenAPI spec 3.0. Default:master. - [x] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
https://github.com/swagger-api/swagger-codegen/issues/5841
Not only host but also scheme and basePath are managed by Configuration::setHost(), Configuration::getHost().
I think that it is better to match API definition key(scheme, host, basePath) and Configuration class interface(setXXX(), getXXX()) to prevent developers from getting confused.
- Changed
hostaccessor manages only host. - Added accessor for
schemebasePath. - Added
baseUrl().
@jebentier @dkarlovi @mandrean @jfastnacht
@ackintosh thanks for the PR. Ruby API client actually follows this approach but the majority of the generators use the current PHP approach.
I'm not sure which one is better for PHP developers but personally I feel comfortable with the current approach even though I worked on the Ruby generator more (I didn't come up with the current Ruby implementation. It was already implemented that way when I started working on this project)