@@ -22,7 +22,7 @@ |
||
22 | 22 | $digits = "(?P<digits>\d*)"; |
23 | 23 | $separator = "(?P<separator>[.,])?"; |
24 | 24 | $decimals = "(?P<decimal1>\d)?(?P<decimal2>\d)?(?P<remaining_decimals>\d)*"; |
25 | - $pattern = "/^".$sign.$digits.$separator.$decimals."$/"; |
|
25 | + $pattern = "/^" . $sign . $digits . $separator . $decimals . "$/"; |
|
26 | 26 | |
27 | 27 | if (!preg_match($pattern, trim($string), $matches)) { |
28 | 28 | throw new InvalidArgumentException("The value could not be parsed as money"); |
@@ -17,8 +17,8 @@ |
||
17 | 17 | { |
18 | 18 | $xmlGroupHeader = $this->getRootElement($document)->GrpHdr; |
19 | 19 | $groupHeader = new Camt054V04DTO\GroupHeader( |
20 | - (string)$xmlGroupHeader->MsgId, |
|
21 | - $this->dateDecoder->decode((string)$xmlGroupHeader->CreDtTm) |
|
20 | + (string) $xmlGroupHeader->MsgId, |
|
21 | + $this->dateDecoder->decode((string) $xmlGroupHeader->CreDtTm) |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | if (isset($xmlGroupHeader->OrgnlBizQry)) { |
@@ -36,8 +36,8 @@ |
||
36 | 36 | { |
37 | 37 | $xmlGroupHeader = $this->getRootElement($document)->GrpHdr; |
38 | 38 | $groupHeader = new DTO\GroupHeader( |
39 | - (string)$xmlGroupHeader->MsgId, |
|
40 | - $this->dateDecoder->decode((string)$xmlGroupHeader->CreDtTm) |
|
39 | + (string) $xmlGroupHeader->MsgId, |
|
40 | + $this->dateDecoder->decode((string) $xmlGroupHeader->CreDtTm) |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | if (isset($xmlGroupHeader->AddtlInf)) { |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | $xmlBalances = $xmlRecord->Bal; |
40 | 40 | foreach ($xmlBalances as $xmlBalance) { |
41 | 41 | $amount = StringToUnits::convert((string) $xmlBalance->Amt); |
42 | - $currency = (string)$xmlBalance->Amt['Ccy']; |
|
43 | - $date = (string)$xmlBalance->Dt->Dt; |
|
42 | + $currency = (string) $xmlBalance->Amt['Ccy']; |
|
43 | + $date = (string) $xmlBalance->Dt->Dt; |
|
44 | 44 | |
45 | 45 | if ((string) $xmlBalance->CdtDbtInd === 'DBIT') { |
46 | 46 | $amount = $amount * -1; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $xmlEntries = $xmlRecord->Ntry; |
81 | 81 | foreach ($xmlEntries as $xmlEntry) { |
82 | 82 | $amount = StringToUnits::convert((string) $xmlEntry->Amt); |
83 | - $currency = (string)$xmlEntry->Amt['Ccy']; |
|
83 | + $currency = (string) $xmlEntry->Amt['Ccy']; |
|
84 | 84 | $bookingDate = ((string) $xmlEntry->BookgDt->Dt) ?: (string) $xmlEntry->BookgDt->DtTm; |
85 | 85 | $valueDate = ((string) $xmlEntry->ValDt->Dt) ?: (string) $xmlEntry->ValDt->DtTm; |
86 | 86 | $additionalInfo = ((string) $xmlEntry->AddtlNtryInf) ?: (string) $xmlEntry->AddtlNtryInf; |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | |
131 | 131 | if (isset($xmlEntry->BkTxCd->Prtry)) { |
132 | 132 | $proprietaryBankTransactionCode = new DTO\ProprietaryBankTransactionCode( |
133 | - (string)$xmlEntry->BkTxCd->Prtry->Cd, |
|
134 | - (string)$xmlEntry->BkTxCd->Prtry->Issr |
|
133 | + (string) $xmlEntry->BkTxCd->Prtry->Cd, |
|
134 | + (string) $xmlEntry->BkTxCd->Prtry->Issr |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | $bankTransactionCode->setProprietary($proprietaryBankTransactionCode); |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | |
140 | 140 | if (isset($xmlEntry->BkTxCd->Domn)) { |
141 | 141 | $domainBankTransactionCode = new DTO\DomainBankTransactionCode( |
142 | - (string)$xmlEntry->BkTxCd->Domn->Cd |
|
142 | + (string) $xmlEntry->BkTxCd->Domn->Cd |
|
143 | 143 | ); |
144 | 144 | |
145 | 145 | if (isset($xmlEntry->BkTxCd->Domn->Fmly)) { |
146 | 146 | $domainFamilyBankTransactionCode = new DTO\DomainFamilyBankTransactionCode( |
147 | - (string)$xmlEntry->BkTxCd->Domn->Fmly->Cd, |
|
148 | - (string)$xmlEntry->BkTxCd->Domn->Fmly->SubFmlyCd |
|
147 | + (string) $xmlEntry->BkTxCd->Domn->Fmly->Cd, |
|
148 | + (string) $xmlEntry->BkTxCd->Domn->Fmly->SubFmlyCd |
|
149 | 149 | ); |
150 | 150 | |
151 | 151 | $domainBankTransactionCode->setFamily($domainFamilyBankTransactionCode); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | if (isset($xmlEntry->Chrgs->TtlChrgsAndTaxAmt) && (string) $xmlEntry->Chrgs->TtlChrgsAndTaxAmt) { |
164 | 164 | $amount = StringToUnits::convert((string) $xmlEntry->Chrgs->TtlChrgsAndTaxAmt); |
165 | - $currency = (string)$xmlEntry->Chrgs->TtlChrgsAndTaxAmt['Ccy']; |
|
165 | + $currency = (string) $xmlEntry->Chrgs->TtlChrgsAndTaxAmt['Ccy']; |
|
166 | 166 | |
167 | 167 | $charges->setTotalChargesAndTaxAmount(new Money($amount, new Currency($currency))); |
168 | 168 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | if (isset($chargesRecord->Amt) && (string) $chargesRecord->Amt) { |
176 | 176 | $amount = StringToUnits::convert((string) $chargesRecord->Amt); |
177 | - $currency = (string)$chargesRecord->Amt['Ccy']; |
|
177 | + $currency = (string) $chargesRecord->Amt['Ccy']; |
|
178 | 178 | |
179 | 179 | if ((string) $chargesRecord->CdtDbtInd === 'DBIT') { |
180 | 180 | $amount = $amount * -1; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | } |
43 | 43 | if (isset($xmlAddress->AdrLine)) { |
44 | 44 | foreach ($xmlAddress->AdrLine as $line) { |
45 | - $address = $address->addAddressLine((string)$line); |
|
45 | + $address = $address->addAddressLine((string) $line); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | /** |
82 | 82 | * @return null|Recipient |
83 | 83 | */ |
84 | - public function getMessageRecipient():?Recipient |
|
84 | + public function getMessageRecipient(): ?Recipient |
|
85 | 85 | { |
86 | 86 | return $this->messageRecipient; |
87 | 87 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | /** |
170 | 170 | * @return null|DateTimeImmutable |
171 | 171 | */ |
172 | - public function getFromDate():?DateTimeImmutable |
|
172 | + public function getFromDate(): ?DateTimeImmutable |
|
173 | 173 | { |
174 | 174 | return $this->fromDate; |
175 | 175 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | /** |
186 | 186 | * @return null|DateTimeImmutable |
187 | 187 | */ |
188 | - public function getToDate():?DateTimeImmutable |
|
188 | + public function getToDate(): ?DateTimeImmutable |
|
189 | 189 | { |
190 | 190 | return $this->toDate; |
191 | 191 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * @return null|ContactDetails |
82 | 82 | */ |
83 | - public function getContactDetails():?ContactDetails |
|
83 | + public function getContactDetails(): ?ContactDetails |
|
84 | 84 | { |
85 | 85 | return $this->contactDetails; |
86 | 86 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | /** |
97 | 97 | * @return null|Identification |
98 | 98 | */ |
99 | - public function getIdentification():?Identification |
|
99 | + public function getIdentification(): ?Identification |
|
100 | 100 | { |
101 | 101 | return $this->identification; |
102 | 102 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | protected function getDefaultMessage() |
13 | 13 | { |
14 | 14 | $dom = new DOMDocument('1.0', 'UTF-8'); |
15 | - $dom->load(__DIR__.'/Camt053/Stubs/camt053.v2.multi.statement.xml'); |
|
15 | + $dom->load(__DIR__ . '/Camt053/Stubs/camt053.v2.multi.statement.xml'); |
|
16 | 16 | return (new MessageFormat\V02)->getDecoder()->decode($dom); |
17 | 17 | } |
18 | 18 |