mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code cleaning stuff.
This commit is contained in:
@@ -82,7 +82,7 @@ class Amount implements ConverterInterface
|
||||
$value = str_replace($search, '', $value);
|
||||
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $original, $value));
|
||||
}
|
||||
if ('.' === $value{0}) {
|
||||
if (strpos($value, '.') === 0) {
|
||||
$value = '0' . $value;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class AssetAccountIbans implements MapperInterface
|
||||
foreach ($set as $account) {
|
||||
$iban = $account->iban ?? '';
|
||||
$accountId = (int)$account->id;
|
||||
if (\strlen($iban) > 0) {
|
||||
if ('' !== $iban) {
|
||||
$name = $account->iban . ' (' . $account->name . ')';
|
||||
|
||||
// is a liability?
|
||||
|
||||
@@ -40,7 +40,9 @@ class AssetAccounts implements MapperInterface
|
||||
{
|
||||
/** @var AccountRepositoryInterface $accountRepository */
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
$set = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE,]);
|
||||
$set = $accountRepository->getAccountsByType(
|
||||
[AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE,]
|
||||
);
|
||||
$list = [];
|
||||
|
||||
/** @var Account $account */
|
||||
@@ -48,7 +50,7 @@ class AssetAccounts implements MapperInterface
|
||||
$accountId = (int)$account->id;
|
||||
$name = $account->name;
|
||||
$iban = $account->iban ?? '';
|
||||
if (\strlen($iban) > 0) {
|
||||
if ('' !== $iban) {
|
||||
$name .= ' (' . $iban . ')';
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class OpposingAccountIbans implements MapperInterface
|
||||
foreach ($set as $account) {
|
||||
$iban = $account->iban ?? '';
|
||||
$accountId = (int)$account->id;
|
||||
if (\strlen($iban) > 0) {
|
||||
if ('' !== $iban) {
|
||||
$name = $account->iban . ' (' . $account->name . ')';
|
||||
|
||||
// is a liability?
|
||||
|
||||
@@ -55,7 +55,7 @@ class OpposingAccounts implements MapperInterface
|
||||
$accountId = (int)$account->id;
|
||||
$name = $account->name;
|
||||
$iban = $account->iban ?? '';
|
||||
if (\strlen($iban) > 0) {
|
||||
if ('' !== $iban) {
|
||||
$name .= ' (' . $iban . ')';
|
||||
}
|
||||
// is a liability?
|
||||
|
||||
@@ -98,8 +98,6 @@ class BunqRoutine implements RoutineInterface
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the import job.
|
||||
*
|
||||
|
||||
@@ -227,7 +227,7 @@ class ImportArrayStorage
|
||||
throw new FireflyException('Could not encode import array. Please see the logs.');
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$hash = hash('sha256', $json, false);
|
||||
$hash = hash('sha256', $json);
|
||||
Log::debug(sprintf('The hash is: %s', $hash));
|
||||
|
||||
return $hash;
|
||||
@@ -338,7 +338,7 @@ class ImportArrayStorage
|
||||
'description' => null,
|
||||
'latitude' => null,
|
||||
'longitude' => null,
|
||||
'zoom_level' => null,
|
||||
'zoom_level' => null,
|
||||
'tagMode' => 'nothing',
|
||||
];
|
||||
$tag = $repository->store($data);
|
||||
|
||||
Reference in New Issue
Block a user