Clean up code.

This commit is contained in:
James Cole
2023-12-10 06:51:59 +01:00
parent c2b22a2bac
commit 46e130fdfe
195 changed files with 973 additions and 984 deletions

View File

@@ -36,7 +36,6 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use FireflyIII\Support\Facades\Amount;
use Illuminate\Support\Collection;
/**
@@ -218,7 +217,7 @@ trait AugumentData
foreach ($set as $entry) {
$currency = $entry->transactionCurrency;
if(null === $currency) {
if (null === $currency) {
$currency = app('amount')->getDefaultCurrency();
}
@@ -226,7 +225,7 @@ trait AugumentData
$currentStart = clone $entry->start_date;
$currentEnd = null === $entry->end_date ? null : clone $entry->end_date;
if(null === $currentEnd) {
if (null === $currentEnd) {
$currentEnd = clone $currentStart;
$currentEnd->addMonth();
}

View File

@@ -116,7 +116,7 @@ trait CreateStuff
Log::alert('NO OAuth keys were found. They have been created.');
file_put_contents($publicKey, (string) $key->getPublicKey());
file_put_contents($publicKey, (string)$key->getPublicKey());
file_put_contents($privateKey, $key->toString('PKCS1'));
}

View File

@@ -80,9 +80,9 @@ trait ModelInformation
$repository = app(AccountRepositoryInterface::class);
// types of liability:
/** @var AccountType $debt */
$debt = $repository->getAccountTypeByType(AccountType::DEBT);
$debt = $repository->getAccountTypeByType(AccountType::DEBT);
/** @var AccountType $loan */
$loan = $repository->getAccountTypeByType(AccountType::LOAN);
$loan = $repository->getAccountTypeByType(AccountType::LOAN);
/** @var AccountType $mortgage */
$mortgage = $repository->getAccountTypeByType(AccountType::MORTGAGE);
$liabilityTypes = [
@@ -260,7 +260,7 @@ trait ModelInformation
'count' => $ii + 1,
'triggers' => $triggers,
];
$string = view('rules.partials.trigger', $renderInfo)->render();
$string = view('rules.partials.trigger', $renderInfo)->render();
} catch (Throwable $e) {
app('log')->debug(sprintf('Throwable was thrown in getTriggersForJournal(): %s', $e->getMessage()));
app('log')->debug($e->getTraceAsString());

View File

@@ -64,7 +64,7 @@ trait RenderPartialViews
$accountRepos = app(AccountRepositoryInterface::class);
$account = $accountRepos->find((int)$attributes['accountId']);
if(null === $budget || null === $account) {
if (null === $budget || null === $account) {
throw new FireflyException('Could not render popup.report.balance-amount because budget or account is null.');
}
@@ -334,7 +334,7 @@ trait RenderPartialViews
if ('user_action' !== $entry->trigger_type) {
$count = ($index + 1);
try {
$rootOperator = OperatorQuerySearch::getRootOperator((string) $entry->trigger_type);
$rootOperator = OperatorQuerySearch::getRootOperator((string)$entry->trigger_type);
if (str_starts_with($rootOperator, '-')) {
$rootOperator = substr($rootOperator, 1);
}
@@ -344,7 +344,7 @@ trait RenderPartialViews
'oldTrigger' => $rootOperator,
'oldValue' => $entry->trigger_value,
'oldChecked' => $entry->stop_processing,
'oldProhibited' => str_starts_with((string) $entry->trigger_type, '-'),
'oldProhibited' => str_starts_with((string)$entry->trigger_type, '-'),
'count' => $count,
'triggers' => $triggers,
]

View File

@@ -139,7 +139,7 @@ trait RuleManagement
$index = 0;
foreach ($submittedOperators as $operator) {
$rootOperator = OperatorQuerySearch::getRootOperator($operator['type']);
$needsContext = (bool) config(sprintf('search.operators.%s.needs_context', $rootOperator));
$needsContext = (bool)config(sprintf('search.operators.%s.needs_context', $rootOperator));
try {
$renderedEntries[] = view(
'rules.partials.trigger',