$currencies All currencies, default first. */ public function __construct( public readonly bool $enabled, public readonly string $default_currency, public readonly array $currencies, ) {} /** * All currency codes, default first. * * @return list */ public function codes(): array { return array_map( static fn ( Currency $currency ): string => $currency->code, $this->currencies ); } /** * Codes of the non-default currencies (empty when multi-currency is disabled). * * @return list */ public function secondary_codes(): array { if ( ! $this->enabled ) { return array(); } return array_values( array_diff( $this->codes(), array( $this->default_currency ) ) ); } }