aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php')
-rw-r--r--vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php b/vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php
index 7d3b90d6e..a95fd5fcb 100644
--- a/vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php
+++ b/vendor/commerceguys/intl/src/Formatter/CurrencyFormatter.php
@@ -21,42 +21,42 @@ class CurrencyFormatter implements CurrencyFormatterInterface
*
* @var NumberFormatRepositoryInterface
*/
- protected $numberFormatRepository;
+ protected NumberFormatRepositoryInterface $numberFormatRepository;
/**
* The currency repository.
*
* @var CurrencyRepositoryInterface
*/
- protected $currencyRepository;
+ protected CurrencyRepositoryInterface $currencyRepository;
/**
* The default locale.
*
* @var string
*/
- protected $defaultLocale;
+ protected string $defaultLocale;
/**
* The loaded number formats.
*
* @var NumberFormat[]
*/
- protected $numberFormats = [];
+ protected array $numberFormats = [];
/**
* The loaded currencies.
*
* @var Currency[]
*/
- protected $currencies = [];
+ protected array $currencies = [];
/**
* The default options.
*
* @var array
*/
- protected $defaultOptions = [
+ protected array $defaultOptions = [
'locale' => 'en',
'use_grouping' => true,
'minimum_fraction_digits' => null,
@@ -90,7 +90,7 @@ class CurrencyFormatter implements CurrencyFormatterInterface
/**
* {@inheritdoc}
*/
- public function format($number, $currencyCode, array $options = [])
+ public function format(string $number, string $currencyCode, array $options = []): string
{
if (!is_numeric($number)) {
$message = sprintf('The provided value "%s" is not a valid number or numeric string.', $number);
@@ -127,7 +127,7 @@ class CurrencyFormatter implements CurrencyFormatterInterface
/**
* {@inheritdoc}
*/
- public function parse($number, $currencyCode, array $options = [])
+ public function parse(string $number, string $currencyCode, array $options = []): string|bool
{
$this->validateOptions($options);
$options = array_replace($this->defaultOptions, $options);
@@ -151,7 +151,7 @@ class CurrencyFormatter implements CurrencyFormatterInterface
*
* @return NumberFormat
*/
- protected function getNumberFormat($locale)
+ protected function getNumberFormat(string $locale): NumberFormat
{
if (!isset($this->numberFormats[$locale])) {
$this->numberFormats[$locale] = $this->numberFormatRepository->get($locale);
@@ -168,7 +168,7 @@ class CurrencyFormatter implements CurrencyFormatterInterface
*
* @return Currency
*/
- protected function getCurrency($currencyCode, $locale)
+ protected function getCurrency(string $currencyCode, string $locale): Currency
{
if (!isset($this->currencies[$currencyCode][$locale])) {
try {
@@ -192,7 +192,7 @@ class CurrencyFormatter implements CurrencyFormatterInterface
/**
* {@inheritdoc}
*/
- protected function getAvailablePatterns(NumberFormat $numberFormat)
+ protected function getAvailablePatterns(NumberFormat $numberFormat): array
{
return [
'standard' => $numberFormat->getCurrencyPattern(),