Fix Laravel Pint formatting

This commit is contained in:
root
2026-06-08 23:30:22 -04:00
parent 567dc24649
commit c792b8be05
1288 changed files with 10766 additions and 9669 deletions
@@ -10,8 +10,7 @@ class FeeRefundCalculatorService
public function __construct(
private FeeConfigService $config,
private FeeStudentFeeService $studentFees
) {
}
) {}
public function calculateRefund(array $students, int $parentId): array
{
@@ -26,6 +25,7 @@ class FeeRefundCalculatorService
'parent_id' => $parentId,
'school_year' => $schoolYear,
]);
return $this->resultPayload(0.0, $totalPaid, $refundDeadline, $schoolEndDate, $weeksOfStudy, 0, []);
}
@@ -36,6 +36,7 @@ class FeeRefundCalculatorService
'parent_id' => $parentId,
'registered_count' => count($registered),
]);
return $this->resultPayload(0.0, $totalPaid, $refundDeadline, $schoolEndDate, $weeksOfStudy, 0, []);
}
@@ -57,7 +58,7 @@ class FeeRefundCalculatorService
$withdrawnWithFees = array_values(array_filter(
$allStudents,
fn (array $student): bool => !empty($student['_is_withdrawn'])
fn (array $student): bool => ! empty($student['_is_withdrawn'])
));
$refundAmount = 0.0;
@@ -82,29 +83,32 @@ class FeeRefundCalculatorService
'reason' => null,
];
if (!$withdrawalDate) {
if (! $withdrawalDate) {
$entry['reason'] = 'missing_withdrawal_date';
Log::warning('Refund skipped for student: missing withdrawal date', [
'parent_id' => $parentId,
'student_id' => $studentId,
]);
$studentBreakdown[] = $entry;
continue;
}
if (!$refundDeadline || strtotime($withdrawalDate) > strtotime($refundDeadline)) {
if (! $refundDeadline || strtotime($withdrawalDate) > strtotime($refundDeadline)) {
$entry['reason'] = 'after_refund_deadline';
$studentBreakdown[] = $entry;
continue;
}
if (!$schoolEndDate) {
if (! $schoolEndDate) {
$entry['reason'] = 'missing_school_end_date';
Log::warning('Refund skipped for student: missing school end date', [
'parent_id' => $parentId,
'student_id' => $studentId,
]);
$studentBreakdown[] = $entry;
continue;
}
@@ -117,6 +121,7 @@ class FeeRefundCalculatorService
'weeks_of_study' => $weeksOfStudy,
]);
$studentBreakdown[] = $entry;
continue;
}
@@ -153,7 +158,7 @@ class FeeRefundCalculatorService
if ($uncappedRefund > 0) {
$ratio = $totalPaid / $uncappedRefund;
foreach ($studentBreakdown as &$row) {
if (!empty($row['eligible'])) {
if (! empty($row['eligible'])) {
$row['refund_amount'] = round($row['refund_amount'] * $ratio, 2);
}
}
@@ -192,6 +197,7 @@ class FeeRefundCalculatorService
foreach ($students as $student) {
if ($this->studentFees->isWithdrawn($student)) {
$withdrawn[] = $student;
continue;
}
@@ -213,6 +219,7 @@ class FeeRefundCalculatorService
}
$daysRemaining = $withdrawDateObj->diff($schoolEndDateObj)->days;
return (int) min($weeksOfStudy, max(0, (int) ceil($daysRemaining / 7)));
}