Skip to content

Commit

Permalink
- Renamed App.locale config key to App.defaultLocale.
Browse files Browse the repository at this point in the history
- Renamed App.timeZone config key to App.defaultTimeZone.
- Renamed App.currency config key to App.defaultCurrency.
- Updated tests.
- Updated README.
  • Loading branch information
elusivecodes committed Nov 20, 2024
1 parent ab3e6ad commit 5efb6fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/FormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5efb6fd

Please sign in to comment.