Skip to content

Commit

Permalink
removed default param usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitl00p committed Mar 18, 2019
1 parent 48bca2f commit 8e6030b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions src/Parser/Banking/Mt940/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static function detectBank($string)
}
}

trigger_error('Unknown mt940 parser loaded, thus reverted to default', E_USER_NOTICE);
trigger_error('Unknown mt940 parser loaded, thus reverted to default');

return new Engine\Unknown();
}
Expand Down Expand Up @@ -357,7 +357,7 @@ protected function parseTimestampFromStatement($key)
if (preg_match('/:' . $key . ':[C|D](\d{6})*/', $this->getCurrentStatementData(), $results)
&& !empty($results[1])
) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand Down Expand Up @@ -390,7 +390,7 @@ protected function parseStatementNumber()
protected function parseTransactionAccount()
{
$results = [];
if (preg_match('/^:86: ?([\d\.]+)\s/im', $this->getCurrentTransactionData(), $results)
if (preg_match('/^:86: ?([\d\.]+)\s/m', $this->getCurrentTransactionData(), $results)
&& !empty($results[1])
) {
return $this->sanitizeAccount($results[1]);
Expand Down Expand Up @@ -509,7 +509,7 @@ protected function parseTransactionTimestamp($key)
if (preg_match('/^:' . $key . ':(\d{6})/', $this->getCurrentTransactionData(), $results)
&& !empty($results[1])
) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand All @@ -528,7 +528,6 @@ protected function parseTransactionCode()
) {
return trim($results[1]);
}

return '';
}

Expand Down Expand Up @@ -587,7 +586,7 @@ protected function sanitizeAccountName($string)
protected function sanitizeTimestamp($string, $inFormat = 'ymd')
{
$date = \DateTime::createFromFormat($inFormat, $string);
$date->setTime(0, 0, 0);
$date->setTime(0, 0);
if ($date !== false) {
return (int)$date->format('U');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Banking/Mt940/Engine/Abn.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function parseTransactionEntryTimestamp()
$entryDate = ($valueDateY + 1) . $entryDateMD;
}

return $this->sanitizeTimestamp($entryDate, 'ymd');
return $this->sanitizeTimestamp($entryDate);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Parser/Banking/Mt940/Engine/Hsbc.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function parseTransactionEntryTimestamp()
{
$results = [];
if (preg_match('/^:60F:[C|D]([\d]{6})/m', $this->getCurrentStatementData(), $results)) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand All @@ -194,7 +194,7 @@ protected function parseTransactionValueTimestamp()
{
$results = [];
if (preg_match(self::PATTERN_TAG_61, $this->getCurrentTransactionData(), $results)) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/Parser/Banking/Mt940/Engine/Rabo.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function parseTransactionEntryTimestamp()
{
$results = [];
if (preg_match('/^:60F:[C|D]([\d]{6})/m', $this->getCurrentStatementData(), $results) && !empty($results[1])) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand All @@ -100,7 +100,7 @@ protected function parseTransactionValueTimestamp()
{
$results = [];
if (preg_match('/^:61:([\d]{6})[C|D]/', $this->getCurrentTransactionData(), $results) && !empty($results[1])) {
return $this->sanitizeTimestamp($results[1], 'ymd');
return $this->sanitizeTimestamp($results[1]);
}

return 0;
Expand Down

0 comments on commit 8e6030b

Please sign in to comment.