forked from loafle/openapi-generator-original
refactor(php): unify $hostSettings variable name (#17828)
This commit is contained in:
parent
f431540075
commit
ec42f88c6a
@ -493,23 +493,23 @@ class Configuration
|
||||
/**
|
||||
* Returns URL based on host settings, index and variables
|
||||
*
|
||||
* @param array $hostsSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param int $hostIndex index of the host settings
|
||||
* @param array|null $variables hash of variable and the corresponding value (optional)
|
||||
* @return string URL based on host settings
|
||||
*/
|
||||
public static function getHostString(array $hostsSettings, int $hostIndex, array $variables = null): string
|
||||
public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string
|
||||
{
|
||||
if (null === $variables) {
|
||||
$variables = [];
|
||||
}
|
||||
|
||||
// check array index out of bound
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings));
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
|
||||
}
|
||||
|
||||
$host = $hostsSettings[$hostIndex];
|
||||
$host = $hostSettings[$hostIndex];
|
||||
$url = $host["url"];
|
||||
|
||||
// go through variable and assign a value
|
||||
|
@ -477,23 +477,23 @@ class Configuration
|
||||
/**
|
||||
* Returns URL based on host settings, index and variables
|
||||
*
|
||||
* @param array $hostsSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param int $hostIndex index of the host settings
|
||||
* @param array|null $variables hash of variable and the corresponding value (optional)
|
||||
* @return string URL based on host settings
|
||||
*/
|
||||
public static function getHostString(array $hostsSettings, int $hostIndex, array $variables = null): string
|
||||
public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string
|
||||
{
|
||||
if (null === $variables) {
|
||||
$variables = [];
|
||||
}
|
||||
|
||||
// check array index out of bound
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings));
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
|
||||
}
|
||||
|
||||
$host = $hostsSettings[$hostIndex];
|
||||
$host = $hostSettings[$hostIndex];
|
||||
$url = $host["url"];
|
||||
|
||||
// go through variable and assign a value
|
||||
|
@ -513,23 +513,23 @@ class Configuration
|
||||
/**
|
||||
* Returns URL based on host settings, index and variables
|
||||
*
|
||||
* @param array $hostsSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param int $hostIndex index of the host settings
|
||||
* @param array|null $variables hash of variable and the corresponding value (optional)
|
||||
* @return string URL based on host settings
|
||||
*/
|
||||
public static function getHostString(array $hostsSettings, int $hostIndex, array $variables = null): string
|
||||
public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string
|
||||
{
|
||||
if (null === $variables) {
|
||||
$variables = [];
|
||||
}
|
||||
|
||||
// check array index out of bound
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings));
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
|
||||
}
|
||||
|
||||
$host = $hostsSettings[$hostIndex];
|
||||
$host = $hostSettings[$hostIndex];
|
||||
$url = $host["url"];
|
||||
|
||||
// go through variable and assign a value
|
||||
|
Loading…
x
Reference in New Issue
Block a user