src/Reader/MzIdentMlReaderFactory.php
public static function getReader($filePath)
    {
        $xmlReader = new \SimpleXMLElement($filePath, null, true);
        
        switch ($xmlReader->attributes()->version) {
            case '1.1.0':
                return new MzIdentMlReader1r1($filePath);
            case '1.2.0':
                return new MzIdentMlReader1r2($filePath);
            default:
                throw new \UnexpectedValueException('Version ' . $xmlReader->attributes()->version . ' is not supported');
        }
    }
public static function getReader($filePath)
    {
        $xmlReader = new \SimpleXMLElement($filePath, null, true);
        
        switch ($xmlReader->attributes()->version) {
            case '1.1.0':
                return new MzIdentMlReader1r1($filePath);
            case '1.2.0':
                return new MzIdentMlReader1r2($filePath);
            default:
                throw new \UnexpectedValueException('Version ' . $xmlReader->attributes()->version . ' is not supported');
        }
    }
public static function getReader ( $ filePath ) { $ xmlReader = new \ SimpleXMLElement ( $ filePath , null , true ) ; switch ( $ xmlReader -> attributes ( ) -> version ) { case '1.1.0' : return new MzIdentMlReader1r1 ( $ filePath ) ; case '1.2.0' : return new MzIdentMlReader1r2 ( $ filePath ) ; default : throw new \ UnexpectedValueException ( 'Version ' . $ xmlReader -> attributes ( ) -> version . ' is not supported' ) ; } }
Parses the XML file to identify the specification version and then returns the appropriate reader

@param string $filePath
Path to the location of the mzIdentML file
@return MzIdentMlReader1Interface
Parses the XML file to identify the specification version and then returns the appropriate reader