Skip to content

Commit 37c0735

Browse files
committed
Revert "Fix redirect issue."
This reverts commit 6b2ddbf.
1 parent 892e181 commit 37c0735

3 files changed

Lines changed: 9 additions & 28 deletions

File tree

app/Http/Controllers/Import/CSV/RoleController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct()
6767
*/
6868
public function index(Request $request)
6969
{
70-
Log::debug('Now in role controller index');
70+
Log::debug('Now in role controller');
7171
$flow = $request->cookie(Constants::FLOW_COOKIE);
7272
if ('csv' !== $flow) {
7373
die('redirect or something');
@@ -112,7 +112,6 @@ public function index(Request $request)
112112
*/
113113
public function postIndex(RolesPostRequest $request): RedirectResponse
114114
{
115-
Log::debug('Now in role controller postindex');
116115
$data = $request->getAll();
117116

118117
// get configuration object.

app/Http/Controllers/Import/MapController.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

app/Services/Shared/Configuration/Configuration.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ private static function fromClassicFile(array $data): self
343343
// loop do mapping from classic file.
344344
$doMapping = $data['column-do-mapping'] ?? [];
345345
foreach ($doMapping as $index => $map) {
346-
$index = (int)$index;
346+
$index = (int) $index;
347347
$object->doMapping[$index] = $map;
348348
}
349349

350350
// loop mapping from classic file.
351351
$mapping = $data['column-mapping-config'] ?? [];
352352
foreach ($mapping as $index => $map) {
353-
$index = (int)$index;
353+
$index = (int) $index;
354354
$object->mapping[$index] = $map;
355355
}
356356
// set version to "2" and return.
@@ -452,7 +452,6 @@ private static function fromVersionThree(array $data): self
452452
{
453453
$object = self::fromArray($data);
454454
$object->specifics = [];
455-
456455
return $object;
457456
}
458457

@@ -516,14 +515,12 @@ public function isIgnoreDuplicateTransactions(): bool
516515

517516
/**
518517
* Return the array but drop some potentially massive arrays.
519-
*
520518
* @return array
521519
*/
522520
public function toSessionArray(): array
523521
{
524522
$array = $this->toArray();
525523
unset($array['mapping'], $array['do_mapping'], $array['roles']);
526-
527524
return $array;
528525
}
529526

@@ -549,7 +546,6 @@ public function toArray(): array
549546
'unique_column_index' => $this->uniqueColumnIndex,
550547
'unique_column_type' => $this->uniqueColumnType,
551548
'version' => $this->version,
552-
'importer_version' => sprintf('data-importer-%s', config('importer.version')),
553549
'flow' => $this->flow,
554550

555551
// spectre
@@ -813,7 +809,6 @@ public function addRequisition(string $key, string $identifier)
813809

814810
/**
815811
* @param string $key
816-
*
817812
* @return string|null
818813
*/
819814
public function getRequisition(string $key): ?string

0 commit comments

Comments
 (0)