mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Code cleanup and realign.
This commit is contained in:
@@ -150,7 +150,7 @@ class ImportDataHandler
|
||||
$destination = $this->mapper->map($possibleDestinationId, $amount, $destinationData);
|
||||
if (1 === bccomp($amount, '0')) {
|
||||
[$source, $destination] = [$destination, $source];
|
||||
$type = $type === 'transfer' ? 'transfer' : 'deposit';
|
||||
$type = 'transfer' === $type ? 'transfer' : 'deposit';
|
||||
Log::debug(sprintf('Amount is %s, so switch source/dest and make this a %s', $amount, $type));
|
||||
}
|
||||
|
||||
|
@@ -70,14 +70,14 @@ class StageGetAccessHandler
|
||||
}
|
||||
$statusCode = $res->getStatusCode();
|
||||
try {
|
||||
$content = trim($res->getBody()->getContents());
|
||||
} catch(RuntimeException $e) {
|
||||
$content = trim($res->getBody()->getContents());
|
||||
} catch (RuntimeException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
throw new FireflyException($e->getMessage());
|
||||
}
|
||||
|
||||
$json = json_decode($content, true) ?? [];
|
||||
$json = json_decode($content, true) ?? [];
|
||||
Log::debug(sprintf('Status code from YNAB is %d', $statusCode));
|
||||
Log::debug(sprintf('Body of result is %s', $content), $json);
|
||||
|
||||
|
@@ -58,7 +58,7 @@ class StageGetBudgetsHandler
|
||||
$configuration['budgets'] = $request->budgets;
|
||||
$this->repository->setConfiguration($this->importJob, $configuration);
|
||||
Log::debug(sprintf('Found %d budgets', \count($request->budgets)));
|
||||
if (\count($request->budgets) === 0) {
|
||||
if (0 === \count($request->budgets)) {
|
||||
throw new FireflyException('It seems this user has zero budgets or an error prevented Firefly III from reading them.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user