src/DataFormatter.php
public static function for_mimetype($mimeType)
    {
        $classes = ClassInfo::subclassesFor(DataFormatter::class);
        array_shift($classes);
        $sortedClasses = [];
        foreach ($classes as $class) {
            $sortedClasses[$class] = Config::inst()->get($class, 'priority');
        }
        arsort($sortedClasses);
        foreach ($sortedClasses as $className => $priority) {
            $formatter = new $className();
            if (in_array($mimeType, $formatter->supportedMimeTypes())) {
                return $formatter;
            }
        }
    }
public static function for_mimetype($mimeType)
    {
        $classes = ClassInfo::subclassesFor(DataFormatter::class);
        array_shift($classes);
        $sortedClasses = [];
        foreach ($classes as $class) {
            $sortedClasses[$class] = Config::inst()->get($class, 'priority');
        }
        arsort($sortedClasses);
        foreach ($sortedClasses as $className => $priority) {
            $formatter = new $className();
            if (in_array($mimeType, $formatter->supportedMimeTypes())) {
                return $formatter;
            }
        }
    }
public static function for_mimetype ( $ mimeType ) { $ classes = ClassInfo :: subclassesFor ( DataFormatter :: class ) ; array_shift ( $ classes ) ; $ sortedClasses = [ ] ; foreach ( $ classes as $ class ) { $ sortedClasses [ $ class ] = Config :: inst ( ) -> get ( $ class , 'priority' ) ; } arsort ( $ sortedClasses ) ; foreach ( $ sortedClasses as $ className => $ priority ) { $ formatter = new $ className ( ) ; if ( in_array ( $ mimeType , $ formatter -> supportedMimeTypes ( ) ) ) { return $ formatter ; } } }
Get a DataFormatter object suitable for handling the given mimetype.

@param string $mimeType
@return DataFormatter
Get a DataFormatter object suitable for handling the given mimetype .