Readers\Pairtwo6::class, 'Pairtwo-5' => Readers\Pairtwo6::class // File structure identical ]; /** * Creates a reader for $type * * @param string $type * @return ReaderInterface */ public static function createReader(string $type): ReaderInterface { if (!isset(self::$readers[$type])) { throw new LibpairtwoException("Cannot read type $type"); } // create reader class $readerClass = self::$readers[$type]; $reader = new $readerClass; return $reader; } }