| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 27 | public function parse($string, Banking\Mt940\Engine $engine = null) |
||
| 28 | { |
||
| 29 | if (!empty($string)) { |
||
| 30 | // load engine |
||
| 31 | if ($engine === null) { |
||
| 32 | $engine = Banking\Mt940\Engine::__getInstance($string); |
||
| 33 | } |
||
| 34 | |||
| 35 | $this->engine = $engine; |
||
| 36 | |||
| 37 | if ($this->engine instanceof Banking\Mt940\Engine) { |
||
|
|
|||
| 38 | // parse using the engine |
||
| 39 | $this->engine->loadString($string); |
||
| 40 | |||
| 41 | return $this->engine->parse(); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return []; |
||
| 46 | } |
||
| 48 |