mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
chore: reformat code.
This commit is contained in:
@@ -43,9 +43,9 @@ class AccountTasker implements AccountTaskerInterface
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -116,9 +116,9 @@ class AccountTasker implements AccountTaskerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -153,51 +153,7 @@ class AccountTasker implements AccountTaskerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
|
||||
{
|
||||
// get all incomes for the given accounts in the given period!
|
||||
// also transfers!
|
||||
// get all transactions:
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setDestinationAccounts($accounts)->setRange($start, $end);
|
||||
$collector->excludeSourceAccounts($accounts);
|
||||
$collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->withAccountInformation();
|
||||
$report = $this->groupIncomeBySource($collector->getExtractedJournals());
|
||||
|
||||
// sort the result
|
||||
// Obtain a list of columns
|
||||
$sum = [];
|
||||
foreach ($report['accounts'] as $accountId => $row) {
|
||||
$sum[$accountId] = (float)$row['sum']; // intentional float
|
||||
}
|
||||
|
||||
array_multisort($sum, SORT_DESC, $report['accounts']);
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User|Authenticatable|null $user
|
||||
*/
|
||||
public function setUser(User|Authenticatable|null $user): void
|
||||
{
|
||||
if (null !== $user) {
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -260,7 +216,41 @@ class AccountTasker implements AccountTaskerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): array
|
||||
{
|
||||
// get all incomes for the given accounts in the given period!
|
||||
// also transfers!
|
||||
// get all transactions:
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setDestinationAccounts($accounts)->setRange($start, $end);
|
||||
$collector->excludeSourceAccounts($accounts);
|
||||
$collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->withAccountInformation();
|
||||
$report = $this->groupIncomeBySource($collector->getExtractedJournals());
|
||||
|
||||
// sort the result
|
||||
// Obtain a list of columns
|
||||
$sum = [];
|
||||
foreach ($report['accounts'] as $accountId => $row) {
|
||||
$sum[$accountId] = (float)$row['sum']; // intentional float
|
||||
}
|
||||
|
||||
array_multisort($sum, SORT_DESC, $report['accounts']);
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -320,4 +310,14 @@ class AccountTasker implements AccountTaskerInterface
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User|Authenticatable|null $user
|
||||
*/
|
||||
public function setUser(User | Authenticatable | null $user): void
|
||||
{
|
||||
if (null !== $user) {
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user