@@ -310,7 +310,7 @@ |
||
| 310 | 310 | */ |
| 311 | 311 | private function cleanString(string $string): string |
| 312 | 312 | { |
| 313 | - $search = [ |
|
| 313 | + $search = [ |
|
| 314 | 314 | "\u{0001}", // start of heading |
| 315 | 315 | "\u{0002}", // start of text |
| 316 | 316 | "\u{0003}", // end of text |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | $values = !is_array($values) ? [] : $values; |
| 114 | 114 | $mapping = !is_array($mapping) ? [] : $mapping; |
| 115 | 115 | $data = []; |
| 116 | - $configuration = Configuration::fromArray(session()->get(Constants::CONFIGURATION)); |
|
| 116 | + $configuration = Configuration::fromArray(session()->get(Constants::CONFIGURATION)); |
|
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // job ID may be in session: |
| 65 | 65 | $identifier = session()->get(Constants::JOB_IDENTIFIER); |
| 66 | - if(null !== $identifier) { |
|
| 66 | + if (null !== $identifier) { |
|
| 67 | 67 | // create a new import job: |
| 68 | - $routine = new ImportRoutineManager($identifier); |
|
| 68 | + $routine = new ImportRoutineManager($identifier); |
|
| 69 | 69 | } |
| 70 | - if(null === $identifier) { |
|
| 70 | + if (null === $identifier) { |
|
| 71 | 71 | // create a new import job: |
| 72 | 72 | $routine = new ImportRoutineManager(); |
| 73 | 73 | $identifier = $routine->getIdentifier(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | session()->put(Constants::JOB_IDENTIFIER, $identifier); |
| 80 | 80 | Log::debug(sprintf('Stored "%s" under "%s"', $identifier, Constants::JOB_IDENTIFIER)); |
| 81 | 81 | |
| 82 | - return view('import.run.index', compact('mainTitle', 'subTitle','identifier')); |
|
| 82 | + return view('import.run.index', compact('mainTitle', 'subTitle', 'identifier')); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | try { |
| 79 | 79 | $configuration = json_decode($json, true, 512, JSON_THROW_ON_ERROR); |
| 80 | 80 | } catch (JsonException $e) { |
| 81 | - $message = sprintf('The importer can\'t import: could not decode the JSON in the config file: %s' , $e->getMessage()); |
|
| 81 | + $message = sprintf('The importer can\'t import: could not decode the JSON in the config file: %s', $e->getMessage()); |
|
| 82 | 82 | $this->error($message); |
| 83 | 83 | Log::error($message); |
| 84 | 84 | |
@@ -198,7 +198,7 @@ |
||
| 198 | 198 | { |
| 199 | 199 | $lineValues = array_values($line); |
| 200 | 200 | array_walk( |
| 201 | - $lineValues, static function ($element) { |
|
| 201 | + $lineValues, static function($element) { |
|
| 202 | 202 | $element = trim(str_replace(' ', ' ', (string)$element)); |
| 203 | 203 | |
| 204 | 204 | return $element; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | foreach ($errors as $error) { |
| 107 | 107 | $msg = sprintf('%s: %s (original value: "%s")', $key, $error, $this->getOriginalValue($key, $line)); |
| 108 | 108 | // plus 1 to keep the count. |
| 109 | - $this->addError($index+1, $msg); |
|
| 109 | + $this->addError($index + 1, $msg); |
|
| 110 | 110 | Log::error($msg); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | round($transaction->amount, $transaction->currencyDecimalPlaces) |
| 128 | 128 | ); |
| 129 | 129 | // plus 1 to keep the count. |
| 130 | - $this->addMessage($index+1, $message); |
|
| 130 | + $this->addMessage($index + 1, $message); |
|
| 131 | 131 | $this->compareArrays($index, $line, $group); |
| 132 | 132 | Log::info($message); |
| 133 | 133 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | private function getOriginalValue(string $key, array $transaction): string |
| 143 | 143 | { |
| 144 | 144 | $parts = explode('.', $key); |
| 145 | - if(1 === count($parts)) { |
|
| 145 | + if (1 === count($parts)) { |
|
| 146 | 146 | return $transaction[$key] ?? '(not found)'; |
| 147 | 147 | } |
| 148 | 148 | if (3 !== count($parts)) { |
@@ -161,11 +161,11 @@ |
||
| 161 | 161 | throw new RuntimeException(sprintf('No place for role "%s"', $value->getRole())); |
| 162 | 162 | } |
| 163 | 163 | if (null === $parsedValue) { |
| 164 | - Log::debug(sprintf('Skip column #%d with role "%s" (in field "%s")', $columnIndex+1, $role, $transactionField)); |
|
| 164 | + Log::debug(sprintf('Skip column #%d with role "%s" (in field "%s")', $columnIndex + 1, $role, $transactionField)); |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | Log::debug( |
| 168 | - sprintf('Stored column #%d with value "%s" and role "%s" in field "%s"', $columnIndex+1, $this->toString($parsedValue), $role, $transactionField) |
|
| 168 | + sprintf('Stored column #%d with value "%s" and role "%s" in field "%s"', $columnIndex + 1, $this->toString($parsedValue), $role, $transactionField) |
|
| 169 | 169 | ); |
| 170 | 170 | |
| 171 | 171 | // if append, append. |
@@ -321,7 +321,7 @@ |
||
| 321 | 321 | return 'withdrawal'; |
| 322 | 322 | } |
| 323 | 323 | // if destination is asset and source is NULL, its a deposit |
| 324 | - if(null === $sourceType && 'asset' === $destinationType){ |
|
| 324 | + if (null === $sourceType && 'asset' === $destinationType) { |
|
| 325 | 325 | Log::debug('Return deposit, dest is asset'); |
| 326 | 326 | return 'deposit'; |
| 327 | 327 | } |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public static function getColumns(string $content, Configuration $configuration): array |
| 49 | 49 | { |
| 50 | - $reader = Reader::createFromString($content); |
|
| 50 | + $reader = Reader::createFromString($content); |
|
| 51 | 51 | |
| 52 | 52 | // configure reader: |
| 53 | 53 | $delimiter = $configuration->getDelimiter(); |
| 54 | - switch($delimiter) { |
|
| 54 | + switch ($delimiter) { |
|
| 55 | 55 | case 'semicolon': |
| 56 | 56 | $reader->setDelimiter(';'); |
| 57 | 57 | break; |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public static function getExampleData(string $content, Configuration $configuration): array |
| 117 | 117 | { |
| 118 | - $reader = Reader::createFromString($content); |
|
| 118 | + $reader = Reader::createFromString($content); |
|
| 119 | 119 | |
| 120 | 120 | // configure reader: |
| 121 | 121 | $delimiter = $configuration->getDelimiter(); |
| 122 | - switch($delimiter) { |
|
| 122 | + switch ($delimiter) { |
|
| 123 | 123 | case 'semicolon': |
| 124 | 124 | $reader->setDelimiter(';'); |
| 125 | 125 | break; |