Skip to content

Commit

Permalink
output warning message before overwriting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Jun 23, 2024
1 parent c272b2c commit f6b2812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AnniversaryCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit f6b2812

Please sign in to comment.