-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Add "servers" support to the operation, path in PHP API client #2072
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,19 +64,47 @@ class AnotherFakeApi | |
*/ | ||
protected $headerSelector; | ||
|
||
/** | ||
* @var Host index | ||
*/ | ||
protected $hostIndex; | ||
|
||
/** | ||
* @param ClientInterface $client | ||
* @param Configuration $config | ||
* @param HeaderSelector $selector | ||
* @param int $host_index | ||
*/ | ||
public function __construct( | ||
ClientInterface $client = null, | ||
Configuration $config = null, | ||
HeaderSelector $selector = null | ||
HeaderSelector $selector = null, | ||
$host_index = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about the I just wondering that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, very good suggestion. My intention is to make the constructor consistent across different API classes. What about updating the doc string to explain it cleary that it's optional and only needed when the endpoint has multiple servers/hosts defined? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with that. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed some enhancements based on your feedback. |
||
) { | ||
$this->client = $client ?: new Client(); | ||
$this->config = $config ?: new Configuration(); | ||
$this->headerSelector = $selector ?: new HeaderSelector(); | ||
$this->hostIndex = $host_index; | ||
} | ||
|
||
/** | ||
* Set the host index | ||
* | ||
* @param int Host index (required) | ||
*/ | ||
public function setHostIndex($host_index) | ||
{ | ||
$this->hostIndex = $host_index; | ||
} | ||
|
||
/** | ||
* Get the host index | ||
* | ||
* @return Host index | ||
*/ | ||
public function getHostIndex() | ||
{ | ||
return $this->hostIndex; | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A 1st keyword of
@var
identifies the type of the property. so I think it would be@var int Host index
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'll update it in the next push