From ec42f88c6a27a0d422390ecdf5adb5785b2be5e7 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 12 Feb 2024 09:13:55 +0100 Subject: [PATCH] refactor(php): unify $hostSettings variable name (#17828) --- .../main/resources/php-nextgen/Configuration.mustache | 10 +++++----- .../client/echo_api/php-nextgen/src/Configuration.php | 10 +++++----- .../OpenAPIClient-php/src/Configuration.php | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/Configuration.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/Configuration.mustache index b88e8e73a6f..618276f51b1 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/Configuration.mustache @@ -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 diff --git a/samples/client/echo_api/php-nextgen/src/Configuration.php b/samples/client/echo_api/php-nextgen/src/Configuration.php index 01aa337e8e6..5ba7deb5695 100644 --- a/samples/client/echo_api/php-nextgen/src/Configuration.php +++ b/samples/client/echo_api/php-nextgen/src/Configuration.php @@ -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 diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Configuration.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Configuration.php index 448cb2b802c..71451e6a5a0 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Configuration.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Configuration.php @@ -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