Code Duplication    Length = 10-10 lines in 3 locations

src/Mt940Parser.php 3 locations

@@ 140-149 (lines=10) @@
137
     *
138
     * @throws \Exception
139
     */
140
    private function parseStatementIdentifier($tagContent)
141
    {
142
        if (preg_match('/ST(\d{6})/', $tagContent, $matches)) {
143
            $generationDate = $matches[1];
144
145
            return $generationDate;
146
        }
147
148
        throw new \Exception('Invalid format of statement identifier');
149
    }
150
151
    /**
152
     * @param string $tagContent
@@ 158-167 (lines=10) @@
155
     *
156
     * @throws \Exception
157
     */
158
    private function parseAccountNumber($tagContent)
159
    {
160
        if (preg_match('/(\d{26})/', $tagContent, $matches)) {
161
            $accountNumber = $matches[1];
162
163
            return $accountNumber;
164
        }
165
166
        throw new \Exception('Invalid format of account number');
167
    }
168
169
    /**
170
     * @param string $tagContent
@@ 176-185 (lines=10) @@
173
     *
174
     * @throws \Exception
175
     */
176
    private function parseStatementNumber($tagContent)
177
    {
178
        if (preg_match('/(\d+)\//', $tagContent, $matches)) {
179
            $statementNumber = $matches[1];
180
181
            return $statementNumber;
182
        }
183
184
        throw new \Exception('Invalid format of statement number');
185
    }
186
187
    /**
188
     * @param string $tagContent