Some cleaning up courtesy of PHPStorm.

This commit is contained in:
James Cole
2016-01-15 19:37:09 +01:00
parent dcbfe90cf7
commit 4e3c59a2da
8 changed files with 40 additions and 37 deletions

View File

@@ -380,6 +380,9 @@ class CategoryController extends Controller
* @param Carbon $end
* @param Collection $accounts
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // need all parameters
* @SuppressWarnings(PHPMD.ExcessuveMethodLength) // need the length
*
* @return \Illuminate\Http\JsonResponse
*/
public function spentInPeriod(CRI $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
@@ -404,18 +407,15 @@ class CategoryController extends Controller
$entries = new Collection;
while ($start < $end) { // filter the set:
$row = [clone $start];
// get possibly relevant entries from the big $set
$currentSet = $set->filter(
$row = [clone $start];
$currentSet = $set->filter(// get possibly relevant entries from the big $set
function (Category $category) use ($start) {
return $category->dateFormatted == $start->format("Y-m");
}
);
// check for each category if its in the current set.
/** @var Category $category */
foreach ($categories as $category) {
// if its in there, use the value.
$entry = $currentSet->filter(
foreach ($categories as $category) {// check for each category if its in the current set.
$entry = $currentSet->filter(// if its in there, use the value.
function (Category $cat) use ($category) {
return ($cat->id == $category->id);
}