refactor(php): unify $hostSettings variable name (#17828)

This commit is contained in:
Simon Podlipsky 2024-02-12 09:13:55 +01:00 committed by GitHub
parent f431540075
commit ec42f88c6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 15 deletions

View File

@ -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

View File

@ -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

View File

@ -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