Repository: symfony/symfony
File: src/Symfony/Component/Intl/Currencies.php (PHP)

Code before:
            return self::readEntry(['Meta', $currency, self::INDEX_CASH_ROUNDING_INCREMENT], 'meta');
        } catch (MissingResourceException) {
            return self::readEntry(['Meta', 'DEFAULT', self::INDEX_CASH_ROUNDING_INCREMENT], 'meta');
        }
    }

    /**
     * @throws MissingResourceException if the currency code has no numeric code
     */
    public static function getNumericCode(string $currency): int
    {
        return self::readEntry(['Alpha3ToNumeric', $currency], 'meta');
    }

    /**
     * @throws MissingResourceException if the numeric code does not exist
     */
    public static function forNumericCode(int $numericCode): array
    {
        return self::readEntry(['NumericToAlpha3', (string) $numericCode], 'meta');
    }

    /**
     * @param non-empty-string   $country     e.g. 'FR'
     * @param ?bool              $legalTender if the currency must be a legal tender. Using null do not filter anything
     * @param ?bool              $active      Indicates whether the currency should always be active for the given $date. Using null do not filter anything
     * @param \DateTimeInterface $date        The date string on which the check will be performed
     *
     * @return list<non-empty-string> a list of unique currencies
     *
     * @throws MissingResourceException if the given $country does not exist
     */
    public static function forCountry(
        string $country,
        ?bool $legalTender = true,
        ?bool $active = true,
        \DateTimeInterface $date = new \DateTimeImmutable('today', new \DateTimeZone('Etc/UTC')),
    ): array {
        $currencies = [];

        foreach (self::readEntry(['Map', $country], 'meta') as $currency => $currencyMetadata) {
            if (null !== $legalTender && $legalTender !== self::isLegalTender($currencyMetadata)) {
                continue;
            }

            if (null === $active) {
                $currencies[] = $currency;

                continue;
            }


Review comment (suggestion):
```suggestion
     * @param ?bool              $active      Indicates whether the currency should always be active for the given $date; null to not filter anything
```

Code after:
            return self::readEntry(['Meta', $currency, self::INDEX_CASH_ROUNDING_INCREMENT], 'meta');
        } catch (MissingResourceException) {
            return self::readEntry(['Meta', 'DEFAULT', self::INDEX_CASH_ROUNDING_INCREMENT], 'meta');
        }
    }

    /**
     * @throws MissingResourceException if the currency code has no numeric code
     */
    public static function getNumericCode(string $currency): int
    {
        return self::readEntry(['Alpha3ToNumeric', $currency], 'meta');
    }

    /**
     * @throws MissingResourceException if the numeric code does not exist
     */
    public static function forNumericCode(int $numericCode): array
    {
        return self::readEntry(['NumericToAlpha3', (string) $numericCode], 'meta');
    }

    /**
     * @param string             $country     e.g. 'FR'
     * @param ?bool              $legalTender If the currency must be a legal tender; null to not filter anything
     * @param ?bool              $active      Indicates whether the currency should always be active for the given $date; null to not filter anything
     * @param \DateTimeInterface $date        The date on which the check will be performed
     *
     * @return list<string> a list of unique currencies
     *
     * @throws MissingResourceException if the given $country does not exist
     */
    public static function forCountry(string $country, ?bool $legalTender = true, ?bool $active = true, \DateTimeInterface $date = new \DateTimeImmutable('today', new \DateTimeZone('Etc/UTC'))): array
    {
        $currencies = [];

        foreach (self::readEntry(['Map', $country], 'meta') as $currency => $currencyMetadata) {
            if (null !== $legalTender && $legalTender !== self::isLegalTender($currencyMetadata)) {
                continue;
            }

            if (null === $active) {
                $currencies[] = $currency;

                continue;
            }

            if (self::isDateActive($country, $currency, $currencyMetadata, $date) !== $active) {
                continue;
            }