-
Notifications
You must be signed in to change notification settings - Fork 59
/
Penta.php
51 lines (44 loc) · 1019 Bytes
/
Penta.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace Kingsquare\Parser\Banking\Mt940\Engine;
use Kingsquare\Parser\Banking\Mt940\Engine;
/**
* @author Kingsquare (source@kingsquare.nl)
* @license http://opensource.org/licenses/MIT MIT
*/
class Penta extends Engine
{
/**
* returns the name of the bank.
*
* @return string
*/
protected function parseStatementBank()
{
return 'PENTA';
}
/**
* split the rawdata up into statementdata chunks.
*
* @return array
*/
protected function parseStatementData()
{
$results = preg_split(
'/(^:20:|^-X{,3}$|\Z)/m',
$this->getRawData(),
-1,
PREG_SPLIT_NO_EMPTY
);
return $results;
}
/**
* Overloaded: Is applicable if second line has :25:TRIODOSBANK.
*
* @inheritdoc
*/
public static function isApplicable($string)
{
$firstline = strtok($string, "\r\n\t");
return strpos($firstline, 'PENTA') !== false;
}
}