@@ 59-71 (lines=13) @@ | ||
56 | * |
|
57 | * @return \CommerceGuys\Intl\Currency\CurrencyRepository |
|
58 | */ |
|
59 | protected function data() |
|
60 | { |
|
61 | $key = $this->getLocalesKey( |
|
62 | $locale = $this->getLocale(), |
|
63 | $fallbackLocale = $this->getFallbackLocale() |
|
64 | ); |
|
65 | ||
66 | if (!isset($this->data[$key])) { |
|
67 | $this->data[$key] = new CurrencyRepository($locale, $fallbackLocale); |
|
68 | } |
|
69 | ||
70 | return $this->data[$key]; |
|
71 | } |
|
72 | ||
73 | /** |
|
74 | * Get the formatter's key. |
|
@@ 122-138 (lines=17) @@ | ||
119 | * |
|
120 | * @return \CommerceGuys\Intl\Formatter\CurrencyFormatter |
|
121 | */ |
|
122 | protected function formatter() |
|
123 | { |
|
124 | $key = $this->getLocalesKey( |
|
125 | $locale = $this->getLocale(), |
|
126 | $fallbackLocale = $this->getFallbackLocale() |
|
127 | ); |
|
128 | ||
129 | if (!isset($this->formatters[$key])) { |
|
130 | $this->formatters[$key] = new CurrencyFormatter( |
|
131 | new NumberFormatRepository($fallbackLocale), |
|
132 | $this->data(), |
|
133 | ['locale' => $locale] |
|
134 | ); |
|
135 | } |
|
136 | ||
137 | return $this->formatters[$key]; |
|
138 | } |
|
139 | ||
140 | /** |
|
141 | * Merges the options array. |
@@ 84-96 (lines=13) @@ | ||
81 | * |
|
82 | * @return \CommerceGuys\Intl\Formatter\NumberFormatter |
|
83 | */ |
|
84 | protected function formatter() |
|
85 | { |
|
86 | $key = $this->getLocalesKey( |
|
87 | $locale = $this->getLocale(), |
|
88 | $fallbackLocale = $this->getFallbackLocale() |
|
89 | ); |
|
90 | ||
91 | if (! isset($this->formatters[$key])) { |
|
92 | $this->formatters[$key] = new NumberFormatter(new NumberFormatRepository($fallbackLocale), ['locale' => $locale]); |
|
93 | } |
|
94 | ||
95 | return $this->formatters[$key]; |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * Merges the options array. |