From 5efb6fd2878f4b43c7264ba3d29b653c221c786a Mon Sep 17 00:00:00 2001 From: Elusive <18050480+elusivecodes@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:51:06 +1000 Subject: [PATCH] - Renamed App.locale config key to App.defaultLocale. - Renamed App.timeZone config key to App.defaultTimeZone. - Renamed App.currency config key to App.defaultCurrency. - Updated tests. - Updated README. --- README.md | 6 +++--- src/Formatter.php | 6 +++--- tests/FormatterTest.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c7391f3..81cb49a 100755 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ $formatter = new Formatter($typeParser, $config); Default configuration options will be resolved from the "*App*" key in the [*Config*](https://github.com/elusivecodes/FyreConfig). - `$options` is an array containing configuration options. - - `locale` is a string representing the default locale, and will default to the system default. - - `timeZone` is a string representing the default time zone, and will default to the system default. - - `currency` is a string representing the default currency, and will default to "*USD*". + - `defaultLocale` is a string representing the default locale, and will default to the system default. + - `defaultTimeZone` is a string representing the default time zone, and will default to the system default. + - `defaultCurrency` is a string representing the default currency, and will default to "*USD*". ```php $container->use(Config::class)->set('App', $options); diff --git a/src/Formatter.php b/src/Formatter.php index 025e31a..8a20de2 100755 --- a/src/Formatter.php +++ b/src/Formatter.php @@ -44,9 +44,9 @@ public function __construct(TypeParser $typeParser, Config $config) $this->dateTimeParser = $typeParser->use('datetime'); $this->timeParser = $typeParser->use('time'); - $this->defaultCurrency = $config->get('App.currency', 'USD'); - $this->defaultLocale = $config->get('App.locale'); - $this->defaultTimeZone = $config->get('App.timeZone'); + $this->defaultCurrency = $config->get('App.defaultCurrency', 'USD'); + $this->defaultLocale = $config->get('App.defaultLocale'); + $this->defaultTimeZone = $config->get('App.defaultTimeZone'); } /** diff --git a/tests/FormatterTest.php b/tests/FormatterTest.php index 4e63af8..895c7cb 100755 --- a/tests/FormatterTest.php +++ b/tests/FormatterTest.php @@ -174,9 +174,9 @@ protected function setUp(): void $container->singleton(TypeParser::class); $container->singleton(Config::class); $container->use(Config::class)->set('App', [ - 'locale' => 'en-US', - 'timeZone' => 'UTC', - 'currency' => 'USD', + 'defaultLocale' => 'en-US', + 'defaultTimeZone' => 'UTC', + 'defaultCurrency' => 'USD', ]); $this->formatter = $container->build(Formatter::class);