From f6b28122acbfade52b50fcb4800c1088a0f83550 Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Sun, 23 Jun 2024 22:00:25 +0200 Subject: [PATCH] output warning message before overwriting variables --- src/AnniversaryCalculator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AnniversaryCalculator.php b/src/AnniversaryCalculator.php index 05437467..c08e026e 100644 --- a/src/AnniversaryCalculator.php +++ b/src/AnniversaryCalculator.php @@ -183,13 +183,13 @@ private function initParameterData() $this->parameterData["LOCALE"] = \Locale::canonicalize($this->parameterData["LOCALE"]); $this->parameterData["BASE_LOCALE"] = \Locale::getPrimaryLanguage($this->parameterData["LOCALE"]); if (false === in_array($this->parameterData["BASE_LOCALE"], self::ALLOWED_LOCALES)) { - $this->parameterData["LOCALE"] = "en_US"; - $this->parameterData["BASE_LOCALE"] = \Locale::getPrimaryLanguage($this->parameterData["LOCALE"]); $this->RESPONSE->Messages[] = sprintf( 'Allowed base locales are: \'%1$s\'; but base locale requested was \'%2$s\'', implode(', ', self::ALLOWED_LOCALES), $this->parameterData["BASE_LOCALE"] ); + $this->parameterData["LOCALE"] = "en_US"; + $this->parameterData["BASE_LOCALE"] = \Locale::getPrimaryLanguage($this->parameterData["LOCALE"]); } } else { $this->parameterData["LOCALE"] = "en_US";