25 foreach ($currencies as $currencyCode => $subunit) {
26 if (empty($currencyCode) || !is_string($currencyCode)) {
27 throw new \InvalidArgumentException(
28 sprintf(
'Currency code must be a string and not empty. "%s" given', $currencyCode)
32 if (!is_int($subunit) || $subunit < 0) {
33 throw new \InvalidArgumentException(
34 sprintf(
'Currency %s does not have a valid minor unit. Must be a positive integer.', $currencyCode)
39 $this->currencies = $currencies;
47 return isset($this->currencies[$currency->getCode()]);
59 return $this->currencies[$currency->
getCode()];
67 return new \ArrayIterator(
72 array_keys($this->currencies)