public function parse($string, Banking\Mt940\Engine $engine = null)
    {
        if (!empty($string)) {
            // load engine
            if ($engine === null) {
                $engine = Banking\Mt940\Engine::__getInstance($string);
            }

            $this->engine = $engine;

            if ($this->engine instanceof Banking\Mt940\Engine) {
                // parse using the engine
                $this->engine->loadString($string);

                return $this->engine->parse();
            }
        }

        return [];
    }
public function parse($string, Banking\Mt940\Engine $engine = null)
    {
        if (!empty($string)) {
            // load engine
            if ($engine === null) {
                $engine = Banking\Mt940\Engine::__getInstance($string);
            }

            $this->engine = $engine;

            if ($this->engine instanceof Banking\Mt940\Engine) {
                // parse using the engine
                $this->engine->loadString($string);

                return $this->engine->parse();
            }
        }

        return [];
    }
public function parse ( $ string , Banking \ Mt940 \ Engine $ engine = null ) { if ( ! empty ( $ string ) ) { // load engine if ( $ engine === null ) { $ engine = Banking \ Mt940 \ Engine :: __getInstance ( $ string ) ; } $ this -> engine = $ engine ; if ( $ this -> engine instanceof Banking \ Mt940 \ Engine ) { // parse using the engine $ this -> engine -> loadString ( $ string ) ; return $ this -> engine -> parse ( ) ; } } return [ ] ; }
Parse the given string into an array of Banking\Statement objects.

@param string $string
@param Banking\Mt940\Engine $engine

@return \Kingsquare\Banking\Statement[]
Parse the given string into an array of Banking \ Statement objects .