@@ -73,7 +73,9 @@ |
||
| 73 | 73 | public function getSignedStartBalance() |
| 74 | 74 | { |
| 75 | 75 | $s = 1; |
| 76 | - if ($this->getCreditDebit() == self::CD_DEBIT) $s = -1; |
|
| 76 | + if ($this->getCreditDebit() == self::CD_DEBIT) { |
|
| 77 | + $s = -1; |
|
| 78 | + } |
|
| 77 | 79 | return $s * $this->getStartBalance(); |
| 78 | 80 | |
| 79 | 81 | } |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | public function parse($target) |
| 41 | 41 | { |
| 42 | 42 | switch ($target) { |
| 43 | - case static::TARGET_ARRAY: |
|
| 44 | - return $this->parseToArray(); |
|
| 45 | - break; |
|
| 46 | - default: |
|
| 47 | - throw new MT940Exception('Invalid parse type provided'); |
|
| 43 | + case static::TARGET_ARRAY: |
|
| 44 | + return $this->parseToArray(); |
|
| 45 | + break; |
|
| 46 | + default: |
|
| 47 | + throw new MT940Exception('Invalid parse type provided'); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -94,20 +94,20 @@ discard block |
||
| 94 | 94 | preg_match('/^\d{6}(\d{4})?(C|D|RC|RD)[A-Z]?([^N]+)N/', $transaction, $matches); |
| 95 | 95 | |
| 96 | 96 | switch($matches[2]) { |
| 97 | - case 'C': |
|
| 98 | - $currentTrx['credit_debit'] = static::CD_CREDIT; |
|
| 99 | - break; |
|
| 100 | - case 'D': |
|
| 101 | - $currentTrx['credit_debit'] = static::CD_DEBIT; |
|
| 102 | - break; |
|
| 103 | - case 'RC': |
|
| 104 | - $currentTrx['credit_debit'] = static::CD_CREDIT_CANCELLATION; |
|
| 105 | - break; |
|
| 106 | - case 'RD': |
|
| 107 | - $currentTrx['credit_debit'] = static::CD_DEBIT_CANCELLATION; |
|
| 108 | - break; |
|
| 109 | - default: |
|
| 110 | - throw new MT940Exception('c/d/rc/rd mark not found in: ' . $transaction); |
|
| 97 | + case 'C': |
|
| 98 | + $currentTrx['credit_debit'] = static::CD_CREDIT; |
|
| 99 | + break; |
|
| 100 | + case 'D': |
|
| 101 | + $currentTrx['credit_debit'] = static::CD_DEBIT; |
|
| 102 | + break; |
|
| 103 | + case 'RC': |
|
| 104 | + $currentTrx['credit_debit'] = static::CD_CREDIT_CANCELLATION; |
|
| 105 | + break; |
|
| 106 | + case 'RD': |
|
| 107 | + $currentTrx['credit_debit'] = static::CD_DEBIT_CANCELLATION; |
|
| 108 | + break; |
|
| 109 | + default: |
|
| 110 | + throw new MT940Exception('c/d/rc/rd mark not found in: ' . $transaction); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $amount = $matches[3]; |
@@ -147,7 +147,9 @@ |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | $statement['transactions'] = $transactions; |
| 150 | - if (count($transactions) > 0) $result[] = $statement; |
|
| 150 | + if (count($transactions) > 0) { |
|
| 151 | + $result[] = $statement; |
|
| 152 | + } |
|
| 151 | 153 | } |
| 152 | 154 | |
| 153 | 155 | return $result; |