<commit_before><?php

namespace Kingsquare\Parser\Banking\Mt940\Engine;

use Kingsquare\Banking\Transaction;
use Kingsquare\Parser\Banking\Mt940\Engine;

/**
 * @author  jun (<EMAIL>)
 * @license http://opensource.org/licenses/MIT MIT
 */
class Hsbc extends Engine
{
    private const PATTERN_TAG_61 = '/^:61:(\d{6})(\d{4}?)(C|D|EC|ED|RC|RD)[A-Z](\d+,\d+)(F|N|S)([A-Z]{3})(.{16})/m';

    /**
     * returns the name of the bank.
     *
     * @return string
     */
    protected function parseStatementBank()
    {
        return 'HSBC';
    }

    /**
     * Overloaded
     *
     * @return array
     */
    protected function parseStatementData()
    {
        $results = preg_split(
            '/(^:20:|^-X{,3}$|\Z)/m',
            $this->getRawData(),
            -1,
            PREG_SPLIT_NO_EMPTY
        );
        return $results;
    }

    /**
     * Overloaded: 16x, like 808XXXXXX292 .<commit_msg>Fix for 'Class constant visibility can be used in PHP 7.1 only'<commit_after><?php

namespace Kingsquare\Parser\Banking\Mt940\Engine;

use Kingsquare\Banking\Transaction;
use Kingsquare\Parser\Banking\Mt940\Engine;

/**
 * @author  jun (<EMAIL>)
 * @license http://opensource.org/licenses/MIT MIT
 */
class Hsbc extends Engine
{
    const PATTERN_TAG_61 = '/^:61:(\d{6})(\d{4}?)(C|D|EC|ED|RC|RD)[A-Z](\d+,\d+)(F|N|S)([A-Z]{3})(.{16})/m';

    /**
     * returns the name of the bank.
     *
     * @return string
     */
    protected function parseStatementBank()
    {
        return 'HSBC';
    }

    /**
     * Overloaded
     *
     * @return array
     */
    protected function parseStatementData()
    {
        $results = preg_split(
            '/(^:20:|^-X{,3}$|\Z)/m',
            $this->getRawData(),
            -1,
            PREG_SPLIT_NO_EMPTY
        );
        return $results;
    }

    /**
     * Overloaded: 16x, like 808XXXXXX292 .
{'fraction_non_alphanumeric': 0.17467948717948717, 'fraction_numerical': 0.029914529914529916, 'mean_word_length': 2.1638513513513513, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2965760', 'n_tokens_mistral': 708, 'n_tokens_neox': 666, 'n_words': 114}