public static function create(Bank $bank, $type)
    {
        if (!isset(self::$allowedTypes[$type])) {
            throw new \Exception('Type is not allowed!');
        }

        $class = __NAMESPACE__ . '\\' . $bank->getParser();

        if (!class_exists($class)) {
            throw new \Exception();
        }

        return new $class();
    }
public static function create(Bank $bank, $type)
    {
        if (!isset(self::$allowedTypes[$type])) {
            throw new \Exception('Type is not allowed!');
        }

        $class = __NAMESPACE__ . '\\' . $bank->getParser();

        if (!class_exists($class)) {
            throw new \Exception();
        }

        return new $class();
    }
public static function create ( Bank $ bank , $ type ) { if ( ! isset ( self :: $ allowedTypes [ $ type ] ) ) { throw new \ Exception ( 'Type is not allowed!' ) ; } $ class = __NAMESPACE__ . '\\' . $ bank -> getParser ( ) ; if ( ! class_exists ( $ class ) ) { throw new \ Exception ( ) ; } return new $ class ( ) ; }
Create new parser.

@param  Bank $bank
@param  string $type
@return ParserInterface
@throws \Exception
Create new parser .