src/SuperParser.php
/**
     * Parse data string
     * 
     * Tries multiple different parsers until it successfully parses anything.
     * 
     * Fails silently when nothing is found or understood. Use with caution.
     * 
     * @param string $raw SwissMetNet data string
     * @return array
     */
Parse data string

Tries multiple different parsers until it successfully parses anything.

Fails silently when nothing is found or understood. Use with caution.

@param string $raw SwissMetNet data string
@return array
Parse data string Tries multiple different parsers until it successfully parses anything . Fails silently when nothing is found or understood . Use with caution . @param string $raw SwissMetNet data string @return array
public static function parse(string $raw)
    {
        $data = DataParser2020::parse($raw);
        if (!empty($data)) {
            return $data;
        }
        $data = DataParser::parse($raw);
        if (!empty($data)) {
            return $data;
        }
        $data = LegacyDataParser::parse($raw);
        if (!empty($data)) {
            return $data;
        }
        return [];
    }
public static function parse ( string $ raw ) { $ data = DataParser2020 :: parse ( $ raw ) ; if ( ! empty ( $ data ) ) { return $ data ; } $ data = DataParser :: parse ( $ raw ) ; if ( ! empty ( $ data ) ) { return $ data ; } $ data = LegacyDataParser :: parse ( $ raw ) ; if ( ! empty ( $ data ) ) { return $ data ; } return [ ] ; }
Parse data string
Parse data string
// Try DataParser2020 // Try DataParser // Try LegacyDataParser