Code Duplication    Length = 18-18 lines in 2 locations

src/Parser/Banking/Mt940/Engine/Rabo.php 1 location

@@ 28-45 (lines=18) @@
25
     *
26
     * {@inheritdoc}
27
     */
28
    protected function parseTransactionAccount()
29
    {
30
        $results = [];
31
        // SEPA MT940 Structured
32
        if (preg_match('/^:61:.*\n(.*?)(\n|\:8)/im', $this->getCurrentTransactionData(), $results)
33
                && !empty($results[1])
34
        ) {
35
            return $this->sanitizeAccount($results[1]);
36
        }
37
38
        if (preg_match('/^:61:.{26}(.{16})/m', $this->getCurrentTransactionData(), $results)
39
                && !empty($results[1])
40
        ) {
41
            return $this->sanitizeAccount($results[1]);
42
        }
43
44
        return '';
45
    }
46
47
    /**
48
     * Overloaded: Rabo has different way of storing account name.

src/Parser/Banking/Mt940/Engine.php 1 location

@@ 242-259 (lines=18) @@
239
     *
240
     * @return string accountnumber
241
     */
242
    protected function parseStatementAccount()
243
    {
244
        $results = [];
245
        if (preg_match('/:25:([\d\.]+)*/', $this->getCurrentStatementData(), $results)
246
                && !empty($results[1])
247
        ) {
248
            return $this->sanitizeAccount($results[1]);
249
        }
250
251
        // SEPA / IBAN
252
        if (preg_match('/:25:([A-Z0-9]{8}[\d\.]+)*/', $this->getCurrentStatementData(), $results)
253
                && !empty($results[1])
254
        ) {
255
            return $this->sanitizeAccount($results[1]);
256
        }
257
258
        return '';
259
    }
260
261
    /**
262
     * uses field 60F to gather starting amount.