@@ -92,15 +92,8 @@ public function index()
9292
9393 // if nothing to map, just set mappable to true and go to the next step:
9494 if (0 === count ($ data )) {
95- Log::debug ('There is nothing to map, fast forward to conversion. ' );
9695 // set map config as complete.
9796 session ()->put (Constants::MAPPING_COMPLETE_INDICATOR , true );
98-
99- // if CSV, now ready for conversion
100- if ('csv ' === $ configuration ->getFlow ()) {
101- session ()->put (Constants::READY_FOR_CONVERSION , true );
102- }
103-
10497 return redirect ()->route ('007-convert.index ' );
10598 }
10699
@@ -164,14 +157,12 @@ private function getCSVMapInformation(): array
164157
165158 // get columns from file
166159 $ content = StorageService::getContent (session ()->get (Constants::UPLOAD_CSV_FILE ), $ configuration ->isConversion ());
167- $ delimiter = (string )config (sprintf ('csv.delimiters.%s ' , $ configuration ->getDelimiter ()));
168-
160+ $ delimiter = (string ) config (sprintf ('csv.delimiters.%s ' , $ configuration ->getDelimiter ()));
169161 return MapperService::getMapData ($ content , $ delimiter , $ configuration ->isHeaders (), $ configuration ->getSpecifics (), $ data );
170162 }
171163
172164 /**
173165 * Weird bunch of code to return info on Spectre and Nordigen.
174- *
175166 * @return array
176167 * @throws ContainerExceptionInterface
177168 * @throws FileNotFoundException
@@ -232,7 +223,6 @@ private function getImporterMapInformation(): array
232223 $ category ['mapped ' ] = $ existingMapping [$ index ] ?? [];
233224 $ data [] = $ category ;
234225 }
235-
236226 return $ data ;
237227 }
238228
@@ -263,8 +253,8 @@ private function getOpposingAccounts(): array
263253 Log::debug (sprintf ('[%s/%s] Parsing transaction ' , ($ index + 1 ), $ total ));
264254 /** @var array $row */
265255 foreach ($ transaction ['transactions ' ] as $ row ) {
266- $ opposing [] = (string )array_key_exists ('destination_name ' , $ row ) ? $ row ['destination_name ' ] : '' ;
267- $ opposing [] = (string )array_key_exists ('source_name ' , $ row ) ? $ row ['source_name ' ] : '' ;
256+ $ opposing [] = (string ) array_key_exists ('destination_name ' , $ row ) ? $ row ['destination_name ' ] : '' ;
257+ $ opposing [] = (string ) array_key_exists ('source_name ' , $ row ) ? $ row ['source_name ' ] : '' ;
268258 }
269259
270260 }
@@ -303,14 +293,14 @@ private function getCategories(): array
303293 Log::debug (sprintf ('[%s/%s] Parsing transaction ' , ($ index + 1 ), $ total ));
304294 /** @var array $row */
305295 foreach ($ transaction ['transactions ' ] as $ row ) {
306- $ categories [] = (string )array_key_exists ('category_name ' , $ row ) ? $ row ['category_name ' ] : '' ;
296+ $ categories [] = (string ) array_key_exists ('category_name ' , $ row ) ? $ row ['category_name ' ] : '' ;
307297 }
308298
309299 }
310300 $ filtered = array_filter (
311301 $ categories ,
312302 static function (?string $ value ) {
313- return '' !== (string )$ value ;
303+ return '' !== (string ) $ value ;
314304 }
315305 );
316306
@@ -351,7 +341,7 @@ public function postIndex(Request $request): RedirectResponse
351341 foreach ($ column as $ valueIndex => $ value ) {
352342 $ mappedValue = $ mapping [$ columnIndex ][$ valueIndex ] ?? null ;
353343 if (null !== $ mappedValue && 0 !== $ mappedValue && '0 ' !== $ mappedValue ) {
354- $ data [$ columnIndex ][$ value ] = (int )$ mappedValue ;
344+ $ data [$ columnIndex ][$ value ] = (int ) $ mappedValue ;
355345 }
356346
357347 }
@@ -400,14 +390,12 @@ public function postIndex(Request $request): RedirectResponse
400390 // if nordigen, now ready for submission!
401391 session ()->put (Constants::READY_FOR_SUBMISSION , true );
402392 }
403-
404393 return redirect ()->route ('007-convert.index ' );
405394 }
406395
407396 /**
408397 * @param array $original
409398 * @param array $new
410- *
411399 * @return array
412400 */
413401 private function mergeMapping (array $ original , array $ new ): array
@@ -426,7 +414,6 @@ private function mergeMapping(array $original, array $new): array
426414 $ original [$ column ] = $ mappedValues ;
427415 }
428416 }
429-
430417 // original has been updated:
431418 return $ original ;
432419 }
0 commit comments