Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix sonarcloud issues
James Cole415fb7294c85
diff --git a/app/Api/V1/Controllers/AccountController.php b/app/Api/V1/Controllers/AccountController.phpindex f3b555b7bf..08a4bf1fa3 100644--- a/app/Api/V1/Controllers/AccountController.php+++ b/app/Api/V1/Controllers/AccountController.php@@ -50,8 +50,9 @@ use League\Fractal\Resource\Item;class AccountController extends Controller{use AccountFilter, TransactionFilter;- /** @var AccountRepositoryInterface The account repository */- private $repository;++ private AccountRepositoryInterface $repository;+ public const RESOURCE_KEY = 'accounts';/*** AccountController constructor.@@ -150,7 +151,7 @@ class AccountController extends Controller$transformer = app(AccountTransformer::class);$transformer->setParameters($this->parameters);- $resource = new FractalCollection($accounts, $transformer, 'accounts');+ $resource = new FractalCollection($accounts, $transformer, self::RESOURCE_KEY);$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');@@ -208,7 +209,7 @@ class AccountController extends Controller/** @var AccountTransformer $transformer */$transformer = app(AccountTransformer::class);$transformer->setParameters($this->parameters);- $resource = new Item($account, $transformer, 'accounts');+ $resource = new Item($account, $transformer, self::RESOURCE_KEY);return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');}@@ -230,7 +231,7 @@ class AccountController extends Controller$transformer = app(AccountTransformer::class);$transformer->setParameters($this->parameters);- $resource = new Item($account, $transformer, 'accounts');+ $resource = new Item($account, $transformer, self::RESOURCE_KEY);return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');}@@ -304,7 +305,7 @@ class AccountController extends Controller/** @var AccountTransformer $transformer */$transformer = app(AccountTransformer::class);$transformer->setParameters($this->parameters);- $resource = new Item($account, $transformer, 'accounts');+ $resource = new Item($account, $transformer, self::RESOURCE_KEY);return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');}diff --git a/app/Api/V1/Controllers/Chart/CategoryController.php b/app/Api/V1/Controllers/Chart/CategoryController.phpindex 9975a0b044..b0b552d516 100644--- a/app/Api/V1/Controllers/Chart/CategoryController.php+++ b/app/Api/V1/Controllers/Chart/CategoryController.php@@ -141,49 +141,6 @@ class CategoryController extends Controller}}- // foreach ([] as $set) {- // foreach ($set as $currency) {- // $inKey = sprintf('%d-i', $currency['currency_id']);- // $outKey = sprintf('%d-e', $currency['currency_id']);- // $categories[] = (string)trans('firefly.no_category');- // // make data arrays if not yet present.- // $tempData[$inKey] = $tempData[$inKey] ?? [- // 'currency_id' => $currency['currency_id'],- // 'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),- // 'currency_code' => $currency['currency_code'],- // 'currency_symbol' => $currency['currency_symbol'],- // 'currency_decimal_places' => $currency['currency_decimal_places'],- // 'type' => 'bar', // line, area or bar- // 'yAxisID' => 0, // 0, 1, 2- // 'entries' => [- // // per category:- // // "category" => 5,- // ],- // ];- // $tempData[$outKey] = $tempData[$outKey] ?? [- // 'currency_id' => $currency['currency_id'],- // 'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),- // 'currency_code' => $currency['currency_code'],- // 'currency_symbol' => $currency['currency_symbol'],- // 'currency_decimal_places' => $currency['currency_decimal_places'],- // 'type' => 'bar', // line, area or bar- // 'yAxisID' => 0, // 0, 1, 2- // 'entries' => [- // // per category:- // // "category" => 5,- // ],- // ];- // foreach ($currency['transaction_journals'] as $journal) {- // // is it expense or income?- // $letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';- // $currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);- // $name = (string)trans('firefly.no_category');- // $tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';- // $tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);- // }- // }- // }-// re-sort every spent array and add 0 for missing entries.foreach ($tempData as $index => $set) {$oldSet = $set['entries'];diff --git a/app/Api/V1/Requests/TransactionUpdateRequest.php b/app/Api/V1/Requests/TransactionUpdateRequest.phpindex e8214cedc7..709419ab1f 100644--- a/app/Api/V1/Requests/TransactionUpdateRequest.php+++ b/app/Api/V1/Requests/TransactionUpdateRequest.php@@ -263,17 +263,13 @@ class TransactionUpdateRequest extends Request// TODO if the transaction_journal_id is empty, some fields are mandatory, like the amount!// all journals must have a description- //$this->validateDescriptions($validator);// // validate foreign currency info- // $this->validateForeignCurrencyInformation($validator);////// // make sure all splits have valid source + dest info- // $this->validateSplitAccounts($validator);// the group must have a description if > 1 journal.- // $this->validateGroupDescription($validator);});}diff --git a/app/Console/Commands/DecryptDatabase.php b/app/Console/Commands/DecryptDatabase.phpindex a568e6bd39..d4457a64a7 100644--- a/app/Console/Commands/DecryptDatabase.php+++ b/app/Console/Commands/DecryptDatabase.php@@ -159,7 +159,6 @@ class DecryptDatabase extends Commandif ('The MAC is invalid.' === $e->getMessage()) {throw new FireflyException($e->getMessage()); // @codeCoverageIgnore}- //Log::debug(sprintf('Could not decrypt. %s', $e->getMessage()));}return $value;diff --git a/app/Console/Commands/Upgrade/MigrateToRules.php b/app/Console/Commands/Upgrade/MigrateToRules.phpindex d751ffa7cd..36c40affab 100644--- a/app/Console/Commands/Upgrade/MigrateToRules.php+++ b/app/Console/Commands/Upgrade/MigrateToRules.php@@ -211,7 +211,6 @@ class MigrateToRules extends Command$lang = app('preferences')->getForUser($user, 'language', 'en_US');$groupTitle = (string) trans('firefly.rulegroup_for_bills_title', [], $lang->data);$ruleGroup = $this->ruleGroupRepository->findByTitle($groupTitle);- //$currency = $this->getCurrency($user);if (null === $ruleGroup) {$ruleGroup = $this->ruleGroupRepository->store(diff --git a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.phpindex 90023cbb92..995a70820c 100644--- a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php+++ b/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php@@ -341,19 +341,17 @@ class TransferCurrenciesCorrections extends Commandif (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore}- // TODO we can use getAccountCurrency() instead- $currencyId = (int) $this->accountRepos->getMetaValue($account, 'currency_id');- $result = $this->currencyRepos->findNull($currencyId);- if (null === $result) {+ $currency = $this->accountRepos->getAccountCurrency($account);+ if (null === $currency) {// @codeCoverageIgnoreStart$this->accountCurrencies[$accountId] = 0;return null;// @codeCoverageIgnoreEnd}- $this->accountCurrencies[$accountId] = $result;+ $this->accountCurrencies[$accountId] = $currency;- return $result;+ return $currency;}/**diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.phpindex 58eddad0f9..6fbd5b8b72 100644--- a/app/Factory/TransactionJournalFactory.php+++ b/app/Factory/TransactionJournalFactory.php@@ -367,19 +367,6 @@ class TransactionJournalFactory// verify that journal has two transactions. Otherwise, delete and cancel.// TODO this can't be faked so it can't be tested.- // $count = $journal->transactions()->count();- // if (2 !== $count) {- // // @codeCoverageIgnoreStart- // Log::error(sprintf('The journal unexpectedly has %d transaction(s). This is not OK. Cancel operation.', $count));- // try {- // $journal->delete();- // } catch (Exception $e) {- // Log::debug(sprintf('Dont care: %s.', $e->getMessage()));- // }- //- // return null;- // // @codeCoverageIgnoreEnd- // }$journal->completed = true;$journal->save();diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.phpindex 8cf1c8c3b3..a683f19c94 100644--- a/app/Helpers/Collector/GroupCollector.php+++ b/app/Helpers/Collector/GroupCollector.php@@ -168,13 +168,8 @@ class GroupCollector implements GroupCollectorInterface*/public function getGroups(): Collection{- //$start = microtime(true);/** @var Collection $result */$result = $this->query->get($this->fields);- //$end = round(microtime(true) - $start, 5);- // log info about query time.- //Log::info(sprintf('Query took Firefly III %s seconds', $end));- //Log::info($this->query->toSql(), $this->query->getBindings());// now to parse this into an array.$collection = $this->parseArray($result);diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.phpindex aa64ccdf36..8dc1c3b0cd 100644--- a/app/Http/Controllers/Category/ShowController.php+++ b/app/Http/Controllers/Category/ShowController.php@@ -79,7 +79,6 @@ class ShowController extends Controller*/public function show(Request $request, Category $category, Carbon $start = null, Carbon $end = null){- //Log::debug('Now in show()');/** @var Carbon $start */$start = $start ?? session('start', Carbon::now()->startOfMonth());/** @var Carbon $end */@@ -106,8 +105,6 @@ class ShowController extends Controller$groups = $collector->getPaginatedGroups();$groups->setPath($path);- //Log::debug('End of show()');-return view('categories.show', compact('category','attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));}diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.phpindex bd16c0b582..856773f78e 100644--- a/app/Http/Controllers/Chart/BudgetController.php+++ b/app/Http/Controllers/Chart/BudgetController.php@@ -111,7 +111,6 @@ class BudgetController extends Controller$loopStart = app('navigation')->startOfPeriod($loopStart, $step);$currencies = [];$defaultEntries = [];- // echo '<hr>';while ($end >= $loopStart) {/** @var Carbon $currentEnd */$loopEnd = app('navigation')->endOfPeriod($loopStart, $step);diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.phpindex be4142a45d..ff52b5f0f6 100644--- a/app/Http/Controllers/Chart/CategoryController.php+++ b/app/Http/Controllers/Chart/CategoryController.php@@ -85,8 +85,6 @@ class CategoryController extends Controller$start = app('navigation')->startOfPeriod($start, $range);$end = $this->getDate();- //Log::debug(sprintf('Full range is %s to %s', $start->format('Y-m-d'), $end->format('Y-m-d')));-/** @var WholePeriodChartGenerator $generator */$generator = app(WholePeriodChartGenerator::class);$chartData = $generator->generate($category, $start, $end);diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.phpindex 4ee924d082..2752d6c994 100644--- a/app/Http/Controllers/Chart/CategoryReportController.php+++ b/app/Http/Controllers/Chart/CategoryReportController.php@@ -64,61 +64,6 @@ class CategoryReportController extends Controller);}- //- // /**- // * Chart for expenses grouped by expense account.- // *- // * TODO this chart is not multi-currency aware.- // *- // * @param Collection $accounts- // * @param Collection $categories- // * @param Carbon $start- // * @param Carbon $end- // * @param string $others- // *- // * @return JsonResponse- // */- // public function accountExpense(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse- // {- // /** @var MetaPieChartInterface $helper */- // $helper = app(MetaPieChartInterface::class);- // $helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === (int)$others);- //- // $chartData = $helper->generate('expense', 'account');- // $data = $this->generator->pieChart($chartData);- //- // return response()->json($data);- // }-- //- // /**- // * Chart for income grouped by revenue account.- // *- // * TODO this chart is not multi-currency aware.- // *- // * @param Collection $accounts- // * @param Collection $categories- // * @param Carbon $start- // * @param Carbon $end- // * @param string $others- // *- // * @return JsonResponse- // */- // public function accountIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end, string $others): JsonResponse- // {- // /** @var MetaPieChartInterface $helper */- // $helper = app(MetaPieChartInterface::class);- // $helper->setAccounts($accounts);- // $helper->setCategories($categories);- // $helper->setStart($start);- // $helper->setEnd($end);- // $helper->setCollectOtherObjects(1 === (int)$others);- // $chartData = $helper->generate('income', 'account');- // $data = $this->generator->pieChart($chartData);- //- // return response()->json($data);- // }-/*** @param Collection $accounts* @param Collection $categoriesdiff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.phpindex 9511699d03..fb62f75f4d 100644--- a/app/Http/Controllers/ProfileController.php+++ b/app/Http/Controllers/ProfileController.php@@ -237,20 +237,16 @@ class ProfileController extends Controller/** @var Collection $set */$set = app('preferences')->findByName('email_change_confirm_token');$user = null;- //Log::debug(sprintf('Found %d preferences', $set->count()));/** @var Preference $preference */foreach ($set as $preference) {if ($preference->data === $token) {- //Log::debug('Found user');$user = $preference->user;}}// update user to clear blocked and blocked_code.if (null === $user) {- //Log::debug('Found no user');throw new FireflyException('Invalid token.');}- //Log::debug('Will unblock user.');$repository->unblockUser($user);// return to login.@@ -372,7 +368,7 @@ class ProfileController extends Controller/*** @return Factory|View*/- public function newBackupCodes()+ public function newBackupCodes(Request $request){if ($this->externalIdentity) {$request->session()->flash('error', trans('firefly.external_user_mgt_disabled'));diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.phpindex f7f682fb07..d628c5fd09 100644--- a/app/Http/Controllers/Recurring/IndexController.php+++ b/app/Http/Controllers/Recurring/IndexController.php@@ -121,10 +121,6 @@ class IndexController extends Controller}}- //if (0 !== $recurrence->recurrenceRepetitions->count()) {- //$array['ocurrences'] = array_slice($this->recurring->getOccurrencesInRange($recurrence->recurrenceRepetitions->first(), $today, $year), 0, 1);- //}-$recurring[] = $array;}$paginator = new LengthAwarePaginator($recurring, $total, $pageSize, $page);diff --git a/app/Http/Controllers/Report/DoubleController.php b/app/Http/Controllers/Report/DoubleController.phpindex f1d399cb8a..d87382a802 100644--- a/app/Http/Controllers/Report/DoubleController.php+++ b/app/Http/Controllers/Report/DoubleController.php@@ -489,287 +489,6 @@ class DoubleController extends Controllerreturn $result;}-- //- //- // /**- // * Generates the overview per budget.- // *- // * @param Collection $accounts- // * @param Collection $expense- // * @param Carbon $start- // * @param Carbon $end- // *- // * @return string- // */- // public function budget(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): string- // {- // // Properties for cache:- // $cache = new CacheProperties;- // $cache->addProperty($start);- // $cache->addProperty($end);- // $cache->addProperty('expense-budget');- // $cache->addProperty($accounts->pluck('id')->toArray());- // $cache->addProperty($expense->pluck('id')->toArray());- // if ($cache->has()) {- // return $cache->get(); // @codeCoverageIgnore- // }- // $combined = $this->combineAccounts($expense);- // $all = new Collection;- // foreach ($combined as $combi) {- // $all = $all->merge($combi);- // }- // // now find spent / earned:- // $spent = $this->spentByBudget($accounts, $all, $start, $end);- // // join arrays somehow:- // $together = [];- // foreach ($spent as $categoryId => $spentInfo) {- // if (!isset($together[$categoryId])) {- // $together[$categoryId]['spent'] = $spentInfo;- // $together[$categoryId]['budget'] = $spentInfo['name'];- // $together[$categoryId]['grand_total'] = '0';- // }- // $together[$categoryId]['grand_total'] = bcadd($spentInfo['grand_total'], $together[$categoryId]['grand_total']);- // }- // try {- // $result = view('reports.partials.exp-budgets', compact('together'))->render();- // // @codeCoverageIgnoreStart- // } catch (Throwable $e) {- // Log::error(sprintf('Could not render category::budget: %s', $e->getMessage()));- // $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());- // }- // // @codeCoverageIgnoreEnd- // $cache->store($result);- //- // return $result;- // }- //- //- //- // /**- // * Generates the overview per category (spent and earned).- // *- // * @param Collection $accounts- // * @param Collection $expense- // * @param Carbon $start- // * @param Carbon $end- // *- // * @return string- // */- // public function category(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): string- // {- // // Properties for cache:- // $cache = new CacheProperties;- // $cache->addProperty($start);- // $cache->addProperty($end);- // $cache->addProperty('expense-category');- // $cache->addProperty($accounts->pluck('id')->toArray());- // $cache->addProperty($expense->pluck('id')->toArray());- // if ($cache->has()) {- // return $cache->get(); // @codeCoverageIgnore- // }- // $combined = $this->combineAccounts($expense);- // $all = new Collection;- // foreach ($combined as $combi) {- // $all = $all->merge($combi);- // }- // // now find spent / earned:- // $spent = $this->spentByCategory($accounts, $all, $start, $end);- // $earned = $this->earnedByCategory($accounts, $all, $start, $end);- // // join arrays somehow:- // $together = [];- // foreach ($spent as $categoryId => $spentInfo) {- // if (!isset($together[$categoryId])) {- // $together[$categoryId]['spent'] = $spentInfo;- // $together[$categoryId]['category'] = $spentInfo['name'];- // $together[$categoryId]['grand_total'] = '0';- // }- // $together[$categoryId]['grand_total'] = bcadd($spentInfo['grand_total'], $together[$categoryId]['grand_total']);- // }- // foreach ($earned as $categoryId => $earnedInfo) {- // if (!isset($together[$categoryId])) {- // $together[$categoryId]['earned'] = $earnedInfo;- // $together[$categoryId]['category'] = $earnedInfo['name'];- // $together[$categoryId]['grand_total'] = '0';- // }- // $together[$categoryId]['grand_total'] = bcadd($earnedInfo['grand_total'], $together[$categoryId]['grand_total']);- // }- // try {- // $result = view('reports.partials.exp-categories', compact('together'))->render();- // // @codeCoverageIgnoreStart- // } catch (Throwable $e) {- // Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));- // $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());- // }- // // @codeCoverageIgnoreEnd- // $cache->store($result);- //- // return $result;- // }- //- //- // /**- // * Overview of spending.- // *- // * @param Collection $accounts- // * @param Collection $expense- // * @param Carbon $start- // * @param Carbon $end- // *- // * @return array|mixed|string- // */- // public function spent(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)- // {- // // chart properties for cache:- // $cache = new CacheProperties;- // $cache->addProperty($start);- // $cache->addProperty($end);- // $cache->addProperty('expense-spent');- // $cache->addProperty($accounts->pluck('id')->toArray());- // $cache->addProperty($expense->pluck('id')->toArray());- // if ($cache->has()) {- // return $cache->get(); // @codeCoverageIgnore- // }- //- // $combined = $this->combineAccounts($expense);- // $result = [];- //- // foreach ($combined as $name => $combi) {- // /**- // * @var string- // * @var Collection $combi- // */- // $spent = $this->spentInPeriod($accounts, $combi, $start, $end);- // $earned = $this->earnedInPeriod($accounts, $combi, $start, $end);- // $result[$name] = [- // 'spent' => $spent,- // 'earned' => $earned,- // ];- // }- // try {- // $result = view('reports.partials.exp-not-grouped', compact('result'))->render();- // // @codeCoverageIgnoreStart- // } catch (Throwable $e) {- // Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));- // $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());- // }- // // @codeCoverageIgnoreEnd- // $cache->store($result);- //- // return $result;- // // for period, get spent and earned for each account (by name)- // }- //- //- // /**- // * List of top expenses.- // *- // * @param Collection $accounts- // * @param Collection $expense- // * @param Carbon $start- // * @param Carbon $end- // *- // * @return string- // */- // public function topExpense(Collection $accounts, Collection $expense, Carbon $start, Carbon $end): string- // {- // // Properties for cache:- // $cache = new CacheProperties;- // $cache->addProperty($start);- // $cache->addProperty($end);- // $cache->addProperty('top-expense');- // $cache->addProperty($accounts->pluck('id')->toArray());- // $cache->addProperty($expense->pluck('id')->toArray());- // if ($cache->has()) {- // return $cache->get(); // @codeCoverageIgnore- // }- // $combined = $this->combineAccounts($expense);- // $all = new Collection;- // foreach ($combined as $combi) {- // $all = $all->merge($combi);- // }- // // get all expenses in period:- // /** @var GroupCollectorInterface $collector */- // $collector = app(GroupCollectorInterface::class);- //- // $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setAccounts($accounts);- // $collector->setAccounts($all)->withAccountInformation();- // $sorted = $collector->getExtractedJournals();- //- // usort($sorted, function ($a, $b) {- // return $a['amount'] <=> $b['amount']; // @codeCoverageIgnore- // });- //- // try {- // $result = view('reports.partials.top-transactions', compact('sorted'))->render();- // // @codeCoverageIgnoreStart- // } catch (Throwable $e) {- // Log::error(sprintf('Could not render category::topExpense: %s', $e->getMessage()));- // $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());- // }- // // @codeCoverageIgnoreEnd- // $cache->store($result);- //- // return $result;- // }- //- // /**- // * List of top income.- // *- // * @param Collection $accounts- // * @param Collection $expense- // * @param Carbon $start- // * @param Carbon $end- // *- // * @return mixed|string- // */- // public function topIncome(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)- // {- // // Properties for cache:- // $cache = new CacheProperties;- // $cache->addProperty($start);- // $cache->addProperty($end);- // $cache->addProperty('top-income');- // $cache->addProperty($accounts->pluck('id')->toArray());- // $cache->addProperty($expense->pluck('id')->toArray());- // if ($cache->has()) {- // return $cache->get(); // @codeCoverageIgnore- // }- // $combined = $this->combineAccounts($expense);- // $all = new Collection;- // foreach ($combined as $combi) {- // $all = $all->merge($combi);- // }- // // get all expenses in period:- //- // /** @var GroupCollectorInterface $collector */- // $collector = app(GroupCollectorInterface::class);- //- // $total = $accounts->merge($all);- // $collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAccounts($total)->withAccountInformation();- // $sorted = $collector->getExtractedJournals();- //- // foreach (array_keys($sorted) as $key) {- // $sorted[$key]['amount'] = bcmul($sorted[$key]['amount'], '-1');- // }- //- // usort($sorted, function ($a, $b) {- // return $a['amount'] <=> $b['amount']; // @codeCoverageIgnore- // });- //- // try {- // $result = view('reports.partials.top-transactions', compact('sorted'))->render();- // // @codeCoverageIgnoreStart- // } catch (Throwable $e) {- // Log::error(sprintf('Could not render category::topIncome: %s', $e->getMessage()));- // $result = sprintf('An error prevented Firefly III from rendering: %s. Apologies.', $e->getMessage());- // }- // // @codeCoverageIgnoreEnd- // $cache->store($result);- //- // return $result;- // }-/*** TODO this method is double.*diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.phpindex c5581e58a5..0adfed6c3c 100644--- a/app/Http/Controllers/Transaction/MassController.php+++ b/app/Http/Controllers/Transaction/MassController.php@@ -182,8 +182,6 @@ class MassController extends Controller$count++;} catch (FireflyException $e) { // @codeCoverageIgnore// do something with error.- //echo $e->getMessage();- //exit;}}diff --git a/app/Http/Middleware/InterestingMessage.php b/app/Http/Middleware/InterestingMessage.phpindex e0fb80cf63..fd49d04d21 100644--- a/app/Http/Middleware/InterestingMessage.php+++ b/app/Http/Middleware/InterestingMessage.php@@ -46,7 +46,6 @@ class InterestingMessage*/public function handle(Request $request, Closure $next){- //Log::debug(sprintf('Interesting Message middleware for URI %s', $request->url()));if ($this->testing()) {return $next($request);}diff --git a/app/Jobs/CreateRecurringTransactions.php b/app/Jobs/CreateRecurringTransactions.phpindex 965609ed27..967df4c2f2 100644--- a/app/Jobs/CreateRecurringTransactions.php+++ b/app/Jobs/CreateRecurringTransactions.php@@ -315,9 +315,6 @@ class CreateRecurringTransactions implements ShouldQueue$this->created++;Log::info(sprintf('Created new transaction group #%d', $group->id));- // link to piggy:- //$this->linkGroupToPiggies($recurrence, $group);-// trigger event:event(new StoredTransactionGroup($group, $recurrence->apply_rules));diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.phpindex 96594e826b..2f9b92538b 100644--- a/app/Providers/AuthServiceProvider.php+++ b/app/Providers/AuthServiceProvider.php@@ -54,14 +54,12 @@ class AuthServiceProvider extends ServiceProvider{Auth::provider('remote_user_provider', function ($app, array $config) {- //Log::debug('Creating remote_user_provider in Closure');return new RemoteUserProvider($app, $config);});Auth::extend('remote_user_guard', static function ($app, string $name, array $config) {- //Log::debug('Creating remote_user_guard in Closure');return new RemoteUserGuard(Auth::createUserProvider($config['provider']), $app);});diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.phpindex 19725336df..47841c640b 100644--- a/app/Repositories/Attachment/AttachmentRepository.php+++ b/app/Repositories/Attachment/AttachmentRepository.php@@ -121,8 +121,7 @@ class AttachmentRepository implements AttachmentRepositoryInterfacetry {$unencryptedContent = Crypt::decrypt($encryptedContent); // verified} catch (DecryptException $e) {- //Log::debug(sprintf('Could not decrypt: %e', $e->getMessage()));- $unencryptedContent = $encryptedContent;+ $unencryptedContent = $encryptedContent;}}diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex 124612a6ca..fbe300a841 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -594,12 +594,9 @@ class BillRepository implements BillRepositoryInterface}// find the most recent date for this bill NOT in the future. Cache this date:$start = clone $bill->date;- //Log::debug('nextDateMatch: Start is ' . $start->format('Y-m-d'));while ($start < $date) {- //Log::debug(sprintf('$start (%s) < $date (%s)', $start->format('Y-m-d'), $date->format('Y-m-d')));$start = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);- //Log::debug('Start is now ' . $start->format('Y-m-d'));}$end = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex a5ba5f1de6..da41d696e0 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -191,7 +191,6 @@ class BudgetRepository implements BudgetRepositoryInterface*/public function getActiveBudgets(): Collection{- //throw new \RuntimeException;/** @var Collection $set */$set = $this->user->budgets()->where('active', 1)->orderBy('order', 'ASC')diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.phpindex 92c3f8e19b..4ca89ddc3f 100644--- a/app/Repositories/Currency/CurrencyRepository.php+++ b/app/Repositories/Currency/CurrencyRepository.php@@ -170,14 +170,6 @@ class CurrencyRepository implements CurrencyRepositoryInterfacereturn 'current_default';}- // // is the default currency for the system- // $defaultSystemCode = config('firefly.default_currency', 'EUR');- // $result = $currency->code === $defaultSystemCode;- // if (true === $result) {- // Log::info('Is the default currency of the SYSTEM, return true.');- //- // return 'system_fallback';- // }Log::debug('Currency is not used, return false.');return null;diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.phpindex 363c4be13c..3bdb71946a 100644--- a/app/Repositories/Recurring/RecurringRepository.php+++ b/app/Repositories/Recurring/RecurringRepository.php@@ -282,7 +282,6 @@ class RecurringRepository implements RecurringRepositoryInterface/** @var RecurrenceMeta $meta */foreach ($transaction->recurrenceTransactionMeta as $meta) {if ('tags' === $meta->name && '' !== $meta->value) {- //$tags = explode(',', $meta->value);$tags = json_decode($meta->value, true, 512, JSON_THROW_ON_ERROR);}}diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.phpindex bf6f2f9ba6..5d462d2bee 100644--- a/app/Services/Internal/Support/RecurringTransactionTrait.php+++ b/app/Services/Internal/Support/RecurringTransactionTrait.php@@ -243,24 +243,6 @@ trait RecurringTransactionTraitreturn $result ?? $repository->getCashAccount();}- // /**- // * Update meta data for recurring transaction.- // *- // * @param Recurrence $recurrence- // * @param array $data- // */- // protected function updateMetaData(Recurrence $recurrence, array $data): void- // {- // // only two special meta fields right now. Let's just hard code them.- // $piggyId = (int)($data['meta']['piggy_bank_id'] ?? 0.0);- // $piggyName = $data['meta']['piggy_bank_name'] ?? '';- // $this->updatePiggyBank($recurrence, $piggyId, $piggyName);- //- // $tags = $data['meta']['tags'] ?? [];- // $this->updateTags($recurrence, $tags);- //- // }-/*** @param RecurrenceTransaction $transaction* @param int $piggyIddiff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.phpindex 96e37d52a8..04a94498c6 100644--- a/app/Support/Authentication/RemoteUserGuard.php+++ b/app/Support/Authentication/RemoteUserGuard.php@@ -81,7 +81,6 @@ class RemoteUserGuard implements Guard*/public function guest(): bool{- //Log::debug(sprintf('Now at %s', __METHOD__));return !$this->check();}@@ -90,7 +89,6 @@ class RemoteUserGuard implements Guard*/public function id(): ?User{- //Log::debug(sprintf('Now at %s', __METHOD__));return $this->user;}@@ -99,7 +97,6 @@ class RemoteUserGuard implements Guard*/public function setUser(Authenticatable $user){- //Log::debug(sprintf('Now at %s', __METHOD__));$this->user = $user;}@@ -108,7 +105,6 @@ class RemoteUserGuard implements Guard*/public function user(): ?User{- //Log::debug(sprintf('Now in user(). Will return NULL: %s', var_export(null === $this->user, true)));return $this->user;}diff --git a/app/Support/Authentication/RemoteUserProvider.php b/app/Support/Authentication/RemoteUserProvider.phpindex 52dd983e75..5b6b0fa4ea 100644--- a/app/Support/Authentication/RemoteUserProvider.php+++ b/app/Support/Authentication/RemoteUserProvider.php@@ -17,16 +17,6 @@ use Str;*/class RemoteUserProvider implements UserProvider{- /**- * RemoteUserProvider constructor.- *- * @param Application $app- * @param array $config- */- public function __construct(Application $app, array $config)- {- //Log::debug('In RemoteUserProvider constructor.');- }/*** @inheritDocdiff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.phpindex 8b10330afd..4a6c9b8ada 100644--- a/app/Support/Binder/AccountList.php+++ b/app/Support/Binder/AccountList.php@@ -44,9 +44,7 @@ class AccountList implements BinderInterface*/public static function routeBinder(string $value, Route $route): Collection{- //Log::debug(sprintf('Now in AccountList::routeBinder("%s")', $value));if (auth()->check()) {- //Log::debug('User is logged in.');$collection = new Collection;if ('allAssetAccounts' === $value) {/** @var Collection $collection */@@ -65,7 +63,6 @@ class AccountList implements BinderInterface->whereIn('accounts.id', $list)->orderBy('accounts.name', 'ASC')->get(['accounts.*']);- //Log::debug(sprintf('Collection length is %d', $collection->count()));}if ($collection->count() > 0) {diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.phpindex af4d28ec6a..518c617234 100644--- a/app/Support/Binder/BudgetList.php+++ b/app/Support/Binder/BudgetList.php@@ -66,7 +66,6 @@ class BudgetList implements BinderInterface->where('active', 1)->whereIn('id', $list)->get();- //Log::debug(sprintf('Found %d active budgets', $collection->count()), $list);// add empty budget if applicable.if (in_array(0, $list, true)) {@@ -75,11 +74,9 @@ class BudgetList implements BinderInterface}if ($collection->count() > 0) {- //Log::debug(sprintf('List length is > 0 (%d), so return it.', $collection->count()));return $collection;}- //Log::debug('List length is zero, fall back to 404.');}Log::warning('BudgetList fallback to 404.');throw new NotFoundHttpException;diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.phpindex 3f21ceb4c2..84c7af2337 100644--- a/app/Support/Http/Controllers/GetConfigurationData.php+++ b/app/Support/Http/Controllers/GetConfigurationData.php@@ -106,12 +106,9 @@ trait GetConfigurationData// first range is the current range:$title => [$start, $end],];- //Log::debug(sprintf('viewRange is %s', $viewRange));- //Log::debug(sprintf('isCustom is %s', var_export($isCustom, true)));// when current range is a custom range, add the current period as the next range.if ($isCustom) {- //Log::debug('Custom is true.');$index = app('navigation')->periodShow($start, $viewRange);$customPeriodStart = app('navigation')->startOfPeriod($start, $viewRange);$customPeriodEnd = app('navigation')->endOfPeriod($customPeriodStart, $viewRange);diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.phpindex 9213277413..67c8d68f2f 100644--- a/app/Support/Http/Controllers/RequestInformation.php+++ b/app/Support/Http/Controllers/RequestInformation.php@@ -166,7 +166,6 @@ trait RequestInformation// both must be array and either must be > 0if (count($intro) > 0 || count($specialIntro) > 0) {$shownDemo = app('preferences')->get($key, false)->data;- //Log::debug(sprintf('Check if user has already seen intro with key "%s". Result is %s', $key, var_export($shownDemo, true)));}if (!is_bool($shownDemo)) {$shownDemo = true; // @codeCoverageIgnorediff --git a/app/Support/Http/Controllers/UserNavigation.php b/app/Support/Http/Controllers/UserNavigation.phpindex e63a550e78..10c3ccbd74 100644--- a/app/Support/Http/Controllers/UserNavigation.php+++ b/app/Support/Http/Controllers/UserNavigation.php@@ -40,10 +40,6 @@ use Log;trait UserNavigation{- //if (!$this->isEditableAccount($account)) {- // return $this->redirectAccountToAccount($account); // @codeCoverageIgnore- // }-/*** Will return false if you cant edit this account type.*diff --git a/app/Support/Navigation.php b/app/Support/Navigation.phpindex 3199d74e29..f523ce665b 100644--- a/app/Support/Navigation.php+++ b/app/Support/Navigation.php@@ -539,7 +539,6 @@ class Navigation$subtract = $subtract ?? 1;$date = clone $theDate;// 1D 1W 1M 3M 6M 1Y- //Log::debug(sprintf('subtractPeriod: date is %s, repeat frequency is %s and subtract is %d', $date->format('Y-m-d'), $repeatFreq, $subtract));$functionMap = ['1D' => 'subDays','daily' => 'subDays',@@ -563,16 +562,12 @@ class Navigationif (isset($functionMap[$repeatFreq])) {$function = $functionMap[$repeatFreq];$date->$function($subtract);- //Log::debug(sprintf('%s is in function map, execute %s with argument %d', $repeatFreq, $function, $subtract));- //Log::debug(sprintf('subtractPeriod: resulting date is %s', $date->format('Y-m-d')));return $date;}if (isset($modifierMap[$repeatFreq])) {$subtract *= $modifierMap[$repeatFreq];$date->subMonths($subtract);- //Log::debug(sprintf('%s is in modifier map with value %d, execute subMonths with argument %d', $repeatFreq, $modifierMap[$repeatFreq], $subtract));- //Log::debug(sprintf('subtractPeriod: resulting date is %s', $date->format('Y-m-d')));return $date;}@@ -585,11 +580,8 @@ class Navigation/** @var Carbon $tEnd */$tEnd = session('end', Carbon::now()->endOfMonth());$diffInDays = $tStart->diffInDays($tEnd);- //Log::debug(sprintf('repeatFreq is %s, start is %s and end is %s (session data).', $repeatFreq, $tStart->format('Y-m-d'), $tEnd->format('Y-m-d')));- //Log::debug(sprintf('Diff in days is %d', $diffInDays));$date->subDays($diffInDays * $subtract);- //Log::debug(sprintf('subtractPeriod: resulting date is %s', $date->format('Y-m-d')));return $date;}diff --git a/app/Validation/RecurrenceValidation.php b/app/Validation/RecurrenceValidation.phpindex f24da81b15..602c08c4e8 100644--- a/app/Validation/RecurrenceValidation.php+++ b/app/Validation/RecurrenceValidation.php@@ -48,7 +48,6 @@ trait RecurrenceValidation*/public function valUpdateAccountInfo(Validator $validator): void{- //Log::debug('Now in validateAccountInformation()');$data = $validator->getData();$transactionType = $data['type'] ?? 'invalid';diff --git a/frontend/src/components/transactions/TransactionListSmall.vue b/frontend/src/components/transactions/TransactionListSmall.vueindex be46f0660d..c6dd403e11 100644--- a/frontend/src/components/transactions/TransactionListSmall.vue+++ b/frontend/src/components/transactions/TransactionListSmall.vue@@ -1,5 +1,13 @@<template><table class="table table-striped">+ <caption>A table containing transactions.</caption>+ <thead>+ <tr>+ <th>TODO</th>+ <th>TODO</th>+ </tr>+ </thead>+ <tbody><tr v-for="transaction in transactions"><td><a href="#">@@ -18,6 +26,7 @@</span></td></tr>+ </tbody></table></template>diff --git a/frontend/src/dist/css/adminlte.css b/frontend/src/dist/css/adminlte.cssindex ef63cddeda..1c6812f946 100755--- a/frontend/src/dist/css/adminlte.css+++ b/frontend/src/dist/css/adminlte.css@@ -91,12 +91,10 @@ p {abbr[title],abbr[data-original-title] {- text-decoration: underline;- -webkit-text-decoration: underline dotted;- text-decoration: underline dotted;+ text-decoration-style: dotted;+ text-decoration-line: underline;cursor: help;border-bottom: 0;- -webkit-text-decoration-skip-ink: none;text-decoration-skip-ink: none;}@@ -31218,4 +31216,4 @@ a.text-muted:hover {[class*="accent-"] a.btn-dark {color: #ffffff;}-/*# sourceMappingURL=adminlte.css.map */\ No newline at end of file+/*# sourceMappingURL=adminlte.css.map */diff --git a/routes/web.php b/routes/web.phpindex bc95d12e86..3ec614779c 100644--- a/routes/web.php+++ b/routes/web.php@@ -87,8 +87,6 @@ Route::group(static function () {Route::post('submit', ['uses' => 'TwoFactorController@submitMFA', 'as' => 'submit']);Route::get('lost', ['uses' => 'TwoFactorController@lostTwoFactor', 'as' => 'lost']);- // Route::post('', ['uses' => 'TwoFactorController@postIndex', 'as' => 'post']);- //});@@ -160,12 +158,6 @@ Route::group('reconcile/{account}/transactions/{start_date?}/{end_date?}',['uses' => 'Json\ReconcileController@transactions', 'as' => 'reconcile.transactions']);-- // show reconciliation- // TODO improve me- //Route::get('reconcile/show/{transactionGroup}', ['uses' => 'Account\ReconcileController@show', 'as' => 'reconcile.show']);- //Route::get('reconcile/edit/{transactionGroup}', ['uses' => 'Account\ReconcileController@edit', 'as' => 'reconcile.edit']);- //Route::post('reconcile/update/{transactionGroup}', ['uses' => 'Account\ReconcileController@update', 'as' => 'reconcile.update']);});diff --git a/tests/Api/V1/Controllers/BudgetLimitControllerTest.php b/tests/Api/V1/Controllers/BudgetLimitControllerTest.phpindex ac0fcff587..943b8eb4ae 100644--- a/tests/Api/V1/Controllers/BudgetLimitControllerTest.php+++ b/tests/Api/V1/Controllers/BudgetLimitControllerTest.php@@ -116,7 +116,6 @@ class BudgetLimitControllerTest extends TestCase];// mock stuff:$repository = $this->mock(BudgetRepositoryInterface::class);- //$repository->shouldReceive('findNull')->andReturn(null)->once();$transformer = $this->mock(BudgetLimitTransformer::class);$blRepository = $this->mock(BudgetLimitRepositoryInterface::class);