Skip to content

Firefly III: a personal finances manager

Some code cleanup.

James Coleec12238ea180
diff --git a/app/Export/Processor.php b/app/Export/Processor.php
index a5e8b1549b..38bc8345df 100644
--- a/app/Export/Processor.php
+++ b/app/Export/Processor.php
@@ -15,6 +15,7 @@ use Config;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\ExportJob;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\Repositories\Journal\JournalCollector;
use Illuminate\Support\Collection;
use Log;
use Storage;
@@ -89,6 +90,7 @@ class Processor
public function collectJournals(): bool
{
$args = [$this->accounts, Auth::user(), $this->settings['startDate'], $this->settings['endDate']];
+ /** @var JournalCollector $journalCollector */
$journalCollector = app('FireflyIII\Repositories\Journal\JournalCollector', $args);
$this->journals = $journalCollector->collect();
Log::debug(
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 44bafbd58b..90eb42c8b4 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -327,9 +327,6 @@ class BillRepository implements BillRepositoryInterface
/**
* Get all journals that were recorded on this bill between these dates.
- *
- * @deprecated
- *
* @param Bill $bill
* @param Carbon $start
* @param Carbon $end
diff --git a/app/Repositories/Journal/JournalCollector.php b/app/Repositories/Journal/JournalCollector.php
index 804b48c087..871563113b 100644
--- a/app/Repositories/Journal/JournalCollector.php
+++ b/app/Repositories/Journal/JournalCollector.php
@@ -47,6 +47,7 @@ class JournalCollector
}
/**
+ * @deprecated
* @return Collection
*/
public function collect(): Collection
diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php
index e70c40a0f7..ea4526806c 100644
--- a/app/Repositories/Journal/JournalRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalRepositoryInterface.php
@@ -86,12 +86,6 @@ interface JournalRepositoryInterface
*/
public function getWithDate(int $journalId, Carbon $date): TransactionJournal;
- /**
- * @param TransactionJournal $journal
- * @param array $array
- *
- * @return void
-
/**
*
* @param TransactionJournal $journal
diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php
index 14fea48a91..a9cbea562f 100644
--- a/app/Repositories/Tag/TagRepository.php
+++ b/app/Repositories/Tag/TagRepository.php
@@ -110,45 +110,6 @@ class TagRepository implements TagRepositoryInterface
return false;
}
- /**
- * @deprecated
- * This method scans the transaction journals from or to the given asset account
- * and checks if these are part of a balancing act. If so, it will sum up the amounts
- * transferred into the balancing act (if any) and return this amount.
- *
- * This method effectively tells you the amount of money that has been balanced out
- * correctly in the given period for the given account.
- *
- * @param Account $account
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return string
- */
- public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string
- {
- // the quickest way to do this is by scanning all balancingAct tags
- // because there will be less of them any way.
- $tags = $this->user->tags()->where('tagMode', 'balancingAct')->get();
- $amount = '0';
-
- /** @var Tag $tag */
- foreach ($tags as $tag) {
- $journals = $tag->transactionjournals()->after($start)->before($end)->transactionTypes([TransactionType::TRANSFER])->get(
- ['transaction_journals.*']
- );
-
- /** @var TransactionJournal $journal */
- foreach ($journals as $journal) {
- if (TransactionJournal::destinationAccount($journal)->id == $account->id) {
- $amount = bcadd($amount, TransactionJournal::amount($journal));
- }
- }
- }
-
- return $amount;
- }
-
/**
* @param Tag $tag
*
diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php
index 0520c1caaf..d8c1d33c05 100644
--- a/app/Repositories/Tag/TagRepositoryInterface.php
+++ b/app/Repositories/Tag/TagRepositoryInterface.php
@@ -34,23 +34,6 @@ interface TagRepositoryInterface
*/
public function connect(TransactionJournal $journal, Tag $tag): bool;
- /**
- * @deprecated
- * This method scans the transaction journals from or to the given asset account
- * and checks if these are part of a balancing act. If so, it will sum up the amounts
- * transferred into the balancing act (if any) and return this amount.
- *
- * This method effectively tells you the amount of money that has been balanced out
- * correctly in the given period for the given account.
- *
- * @param Account $account
- * @param Carbon $start
- * @param Carbon $end
- *
- * @return string
- */
- public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string;
-
/**
* @param Tag $tag
*