public static function findMainCode($codes)
    {
        foreach (static::mainCodes() as $code) {
            if (in_array($code, $codes)) {
                return $code;
            }
        }

        return null;
    }
public static function findMainCode($codes)
    {
        foreach (static::mainCodes() as $code) {
            if (in_array($code, $codes)) {
                return $code;
            }
        }

        return null;
    }
public static function findMainCode ( $ codes ) { foreach ( static :: mainCodes ( ) as $ code ) { if ( in_array ( $ code , $ codes ) ) { return $ code ; } } return null ; }
Find main ISO 4217 currency code in a list
@param string[] $codes list of currency codes
@return string|null
Find main ISO 4217 currency code in a list