mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-03 12:45:20 +00:00
Various code cleanup. [skip ci]
This commit is contained in:
@@ -52,7 +52,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// @var AttachmentRepositoryInterface repository
|
||||
/** @var AttachmentRepositoryInterface repository */
|
||||
$this->repository = app(AttachmentRepositoryInterface::class);
|
||||
// make storage:
|
||||
$this->uploadDisk = Storage::disk('upload');
|
||||
|
||||
@@ -26,6 +26,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Steam;
|
||||
@@ -173,7 +174,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$startBalance = $dayBeforeBalance;
|
||||
$currency = $currencyRepos->find(intval($account->getMeta('currency_id')));
|
||||
|
||||
// @var Transaction $journal
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journals as $transaction) {
|
||||
$transaction->before = $startBalance;
|
||||
$transactionAmount = $transaction->transaction_amount;
|
||||
|
||||
@@ -129,12 +129,12 @@ class CategoryController extends Controller
|
||||
$report = [];
|
||||
/** @var Category $category */
|
||||
foreach ($categories as $category) {
|
||||
$spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $end);
|
||||
if (0 !== bccomp($spent, '0')) {
|
||||
$report[$category->id] = ['name' => $category->name, 'spent' => $spent, 'id' => $category->id];
|
||||
$spent = $repository->spentInPeriod(new Collection([$category]), $accounts, $start, $end);
|
||||
$earned = $repository->earnedInPeriod(new Collection([$category]), $accounts, $start, $end);
|
||||
if (0 !== bccomp($spent, '0') || 0 !== bccomp($earned, '0')) {
|
||||
$report[$category->id] = ['name' => $category->name, 'spent' => $spent, 'earned' => $earned, 'id' => $category->id];
|
||||
}
|
||||
}
|
||||
|
||||
// sort the result
|
||||
// Obtain a list of columns
|
||||
$sum = [];
|
||||
|
||||
@@ -158,7 +158,7 @@ class PiggyBank extends Model
|
||||
public function leftOnAccount(Carbon $date): string
|
||||
{
|
||||
$balance = Steam::balanceIgnoreVirtual($this->account, $date);
|
||||
// @var PiggyBank $p
|
||||
/** @var PiggyBank $piggyBank */
|
||||
foreach ($this->account->piggyBanks as $piggyBank) {
|
||||
$currentAmount = $piggyBank->currentRelevantRep()->currentamount ?? '0';
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class TagRepository implements TagRepositoryInterface
|
||||
public function findByTag(string $tag): Tag
|
||||
{
|
||||
$tags = $this->user->tags()->get();
|
||||
// @var Tag $tag
|
||||
/** @var Tag $databaseTag */
|
||||
foreach ($tags as $databaseTag) {
|
||||
if ($databaseTag->tag === $tag) {
|
||||
return $databaseTag;
|
||||
|
||||
Reference in New Issue
Block a user