Code cleanup.

This commit is contained in:
James Cole
2016-11-18 20:06:08 +01:00
parent 0c072c7d51
commit 73f0cc705b
41 changed files with 160 additions and 24 deletions

View File

@@ -353,25 +353,6 @@ class CategoryReportController extends Controller
return $set;
}
/**
* @param Collection $set
*
* @return array
*/
private function groupByAccount(Collection $set): array
{
// group by category ID:
$grouped = [];
/** @var Transaction $transaction */
foreach ($set as $transaction) {
$accountId = $transaction->account_id;
$grouped[$accountId] = $grouped[$accountId] ?? '0';
$grouped[$accountId] = bcadd($transaction->transaction_amount, $grouped[$accountId]);
}
return $grouped;
}
/**
* @param Collection $set
*

View File

@@ -100,8 +100,9 @@ class ReportController extends Controller
* @param Carbon $end
* @param Collection $accounts
*
* @param Collection $categories
*
* @return string
* @throws FireflyException
*/
public function categoryReport(Carbon $start, Carbon $end, Collection $accounts, Collection $categories)
{

View File

@@ -35,6 +35,7 @@ class SearchController extends Controller
/**
* Results always come in the form of an array [results, count, fullCount]
*
* @param Request $request
* @param SearchInterface $searcher
*
* @return $this