mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Reformatted code according to scrutinizer-ci.
This commit is contained in:
parent
eed3d021d9
commit
26fb03e6c8
@ -17,7 +17,7 @@ class AmountComma extends BasicConverter implements ConverterInterface
|
||||
*/
|
||||
public function convert()
|
||||
{
|
||||
$value = str_replace(",", ".", $this->value );
|
||||
$value = str_replace(',', '.', $this->value);
|
||||
|
||||
if (is_numeric($value)) {
|
||||
return floatval($value);
|
||||
|
@ -31,8 +31,8 @@ class AbnAmroDescription
|
||||
|
||||
// If the description could not be parsed, specify an unknown opposing
|
||||
// account, as an opposing account is required
|
||||
if( !$parsed ) {
|
||||
$this->data[ "opposing-account-name" ] = trans('firefly.unknown');
|
||||
if (!$parsed) {
|
||||
$this->data['opposing-account-name'] = trans('firefly.unknown');
|
||||
}
|
||||
|
||||
return $this->data;
|
||||
@ -61,18 +61,17 @@ class AbnAmroDescription
|
||||
protected function parseSepaDescription()
|
||||
{
|
||||
// See if the current description is formatted as a SEPA plain description
|
||||
if( preg_match( "/^SEPA(.{28})/", $this->data[ "description" ], $matches ) ) {
|
||||
if (preg_match('/^SEPA(.{28})/', $this->data['description'], $matches)) {
|
||||
Log::debug('AbnAmroSpecifix: Description is structured as SEPA plain description.');
|
||||
$type = trim($matches[1]);
|
||||
|
||||
// SEPA plain descriptions contain several key-value pairs, split by a colon
|
||||
preg_match_all( "/([A-Za-z]+(?=:\s)):\s([A-Za-z 0-9._#-]+(?=\s))/", $this->data[ "description" ], $matches, PREG_SET_ORDER );
|
||||
preg_match_all('/([A-Za-z]+(?=:\s)):\s([A-Za-z 0-9._#-]+(?=\s))/', $this->data['description'], $matches, PREG_SET_ORDER);
|
||||
|
||||
foreach( $matches as $match ) {
|
||||
$key = $match[1];
|
||||
foreach ($matches as $match) {
|
||||
$key = $match[1];
|
||||
$value = trim($match[2]);
|
||||
|
||||
switch( strtoupper($key) ) {
|
||||
switch (strtoupper($key)) {
|
||||
case 'OMSCHRIJVING':
|
||||
$this->data['description'] = $value;
|
||||
break;
|
||||
@ -100,17 +99,18 @@ class AbnAmroDescription
|
||||
protected function parseTRTPDescription()
|
||||
{
|
||||
// See if the current description is formatted in TRTP format
|
||||
if( preg_match_all( "!\/([A-Z]{3,4})\/([^/]*)!", $this->data[ "description" ], $matches, PREG_SET_ORDER ) ) {
|
||||
if (preg_match_all('!\/([A-Z]{3,4})\/([^/]*)!', $this->data['description'], $matches, PREG_SET_ORDER)) {
|
||||
Log::debug('AbnAmroSpecifix: Description is structured as TRTP format.');
|
||||
|
||||
foreach( $matches as $match ) {
|
||||
$key = $match[1];
|
||||
foreach ($matches as $match) {
|
||||
$key = $match[1];
|
||||
$value = trim($match[2]);
|
||||
|
||||
switch( strtoupper($key) ) {
|
||||
case 'TRTP':
|
||||
$type = $value;
|
||||
break;
|
||||
switch (strtoupper($key)) {
|
||||
// is not being used.
|
||||
// case 'TRTP':
|
||||
// $type = $value;
|
||||
// break;
|
||||
case 'NAME':
|
||||
$this->data['opposing-account-name'] = $value;
|
||||
break;
|
||||
@ -138,11 +138,12 @@ class AbnAmroDescription
|
||||
protected function parseGEABEADescription()
|
||||
{
|
||||
// See if the current description is formatted in GEA/BEA format
|
||||
if( preg_match( "/([BG]EA) +(NR:[a-zA-Z:0-9]+) +([0-9.\/]+) +([^,]*)/", $this->data[ "description" ], $matches ) ) {
|
||||
if (preg_match('/([BG]EA) +(NR:[a-zA-Z:0-9]+) +([0-9.\/]+) +([^,]*)/', $this->data['description'], $matches)) {
|
||||
Log::debug('AbnAmroSpecifix: Description is structured as GEA or BEA format.');
|
||||
|
||||
$this->data[ "opposing-account-name" ] = $matches[4];
|
||||
$this->data[ "description" ] = $matches[4];
|
||||
// description and opposing account will be the same.
|
||||
$this->data['opposing-account-name'] = $matches[4];
|
||||
$this->data['description'] = $matches[4];
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -152,16 +153,16 @@ class AbnAmroDescription
|
||||
|
||||
/**
|
||||
* Parses the current description with costs from ABN AMRO itself
|
||||
* @return boolean true if the description is GEA/BEAformat, false otherwise
|
||||
* @return boolean true if the description is GEA/BEA-format, false otherwise
|
||||
*/
|
||||
protected function parseABNAMRODescription()
|
||||
{
|
||||
// See if the current description is formatted in ABN AMRO format
|
||||
if( preg_match( "/ABN AMRO.{24} (.*)/", $this->data[ "description" ], $matches ) ) {
|
||||
if (preg_match('/ABN AMRO.{24} (.*)/', $this->data['description'], $matches)) {
|
||||
Log::debug('AbnAmroSpecifix: Description is structured as costs from ABN AMRO itself.');
|
||||
|
||||
$this->data[ "opposing-account-name" ] = "ABN AMRO";
|
||||
$this->data[ "description" ] = $matches[1];
|
||||
$this->data['opposing-account-name'] = "ABN AMRO";
|
||||
$this->data['description'] = $matches[1];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user