Automattic\WooCommerce\Vendor\League\ISO3166
ISO3166::iterator
Method of the class: ISO3166{}
No Hooks.
Returns
\Generator
Usage
$ISO3166 = new ISO3166(); $ISO3166->iterator( $key ): \Generator;
- $key('name'|'alpha2'|'alpha3'|'numeric')
- .
Default: self::KEY_ALPHA2
ISO3166::iterator() ISO3166::iterator code WC 10.3.6
public function iterator(string $key = self::KEY_ALPHA2): \Generator
{
if (!in_array($key, $this->keys, true)) {
throw new DomainException(sprintf('Invalid value for $key, got "%s", expected one of: %s', $key, implode(', ', $this->keys)));
}
foreach ($this->countries as $country) {
yield $country[$key] => $country;
}
}