Skip to content

Commit 5231683

Browse files
JhumanJactions-user
authored andcommitted
Fix styling
1 parent 07d8360 commit 5231683

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/Http/Controllers/StatController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ public function widgetData(DataRequest $request)
2222
case 'period_total':
2323
return $modelStats->getPeriodTotal($dateFrom, $dateTo, $request->date_column);
2424
case 'group_by_count':
25-
return $modelStats->getGroupByCount($dateFrom, $dateTo, $request->date_column,
26-
$request->aggregate_column);
25+
return $modelStats->getGroupByCount(
26+
$dateFrom,
27+
$dateTo,
28+
$request->date_column,
29+
$request->aggregate_column
30+
);
2731
default:
2832
throw new \Exception('Wigdet aggregate type not supported.');
2933
}

src/Http/Requests/Widgets/DataRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class DataRequest extends FormRequest
1616
'daily_count',
1717
'cumulated_daily_count',
1818
'period_total',
19-
'group_by_count'
19+
'group_by_count',
2020
];
2121

2222
const AGGREGATES_TYPES_WITH_AGGREGATE_COLUMN = [
23-
'group_by_count'
23+
'group_by_count',
2424
];
2525

2626
/**
@@ -36,7 +36,7 @@ public function rules()
3636
'date_column' => 'required',
3737
'date_from' => 'required|date_format:Y-m-d|before:date_to',
3838
'date_to' => 'required|date_format:Y-m-d|after:date_from',
39-
'aggregate_column' => [Rule::requiredIf( in_array(request()->aggregate_type, self::AGGREGATES_TYPES_WITH_AGGREGATE_COLUMN))],
39+
'aggregate_column' => [Rule::requiredIf(in_array(request()->aggregate_type, self::AGGREGATES_TYPES_WITH_AGGREGATE_COLUMN))],
4040
];
4141
}
4242

src/Services/ModelStats.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ public static function fillMissingDays($data, Carbon $since, Carbon $to, $defaul
106106

107107
foreach (array_reverse(range(0, $daysSince)) as $number) {
108108
$dateKey = $to->copy()->subDays($number)->format('Y-m-d');
109-
if (!isset($data[$dateKey])) {
109+
if (! isset($data[$dateKey])) {
110110
$data[$dateKey] = $defaultValue;
111111
}
112112

113-
if (!is_null($cumulatedSum)) {
113+
if (! is_null($cumulatedSum)) {
114114
$data[$dateKey] += $cumulatedSum;
115115
$cumulatedSum = $data[$dateKey];
116116
}

0 commit comments

Comments
 (0)