Fix Pint formatting

This commit is contained in:
root
2026-06-09 01:25:14 -04:00
parent 6be4875c5e
commit 20a0b6c4e5
1485 changed files with 11318 additions and 10273 deletions
@@ -24,13 +24,12 @@ class PromotionEligibilityService
private LevelProgressionService $progression,
private PromotionStatusService $statusService,
private PromotionAuditService $audit
) {
}
) {}
/**
* Evaluate eligibility for a single student.
*
* @param int|null $userId actor id for audit
* @param int|null $userId actor id for audit
*/
public function evaluateStudent(
int $studentId,
@@ -38,7 +37,7 @@ class PromotionEligibilityService
?int $userId = null
): ?StudentPromotionRecord {
$student = Student::query()->find($studentId);
if (!$student) {
if (! $student) {
return null;
}
@@ -83,7 +82,7 @@ class PromotionEligibilityService
$summary = $this->emptySummary();
foreach ($studentIds as $studentId) {
$student = Student::query()->find($studentId);
if (!$student) {
if (! $student) {
continue;
}
try {
@@ -132,7 +131,7 @@ class PromotionEligibilityService
$summary = $this->emptySummary();
foreach ($studentIds as $studentId) {
$student = Student::query()->find($studentId);
if (!$student) {
if (! $student) {
continue;
}
try {
@@ -214,7 +213,7 @@ class PromotionEligibilityService
->first();
$isNew = $existing === null;
$record = $existing ?: new StudentPromotionRecord();
$record = $existing ?: new StudentPromotionRecord;
$record->fill([
'student_id' => $studentId,
'parent_id' => (int) ($student->parent_id ?? 0) ?: null,
@@ -288,7 +287,7 @@ class PromotionEligibilityService
->orderByDesc('id')
->first();
if (!$decision) {
if (! $decision) {
return [
'passed' => null,
'final_average' => null,
@@ -332,14 +331,14 @@ class PromotionEligibilityService
return [
'passed' => null,
'final_average' => $score,
'notes' => 'student_decisions has unrecognized decision: ' . $rawDecision,
'notes' => 'student_decisions has unrecognized decision: '.$rawDecision,
'has_data' => false,
];
}
private function resolveStatusFromEvaluation(?bool $passed, bool $terminal, bool $hasData): string
{
if (!$hasData) {
if (! $hasData) {
return StudentPromotionRecord::STATUS_ON_HOLD;
}
if ($passed === false) {
@@ -348,6 +347,7 @@ class PromotionEligibilityService
if ($terminal) {
return StudentPromotionRecord::STATUS_GRADUATED;
}
return StudentPromotionRecord::STATUS_AWAITING_PARENT;
}
@@ -380,15 +380,17 @@ class PromotionEligibilityService
private function resolveCurrentSchoolYear(): ?string
{
$year = (string) (Configuration::getConfigValueByKey('school_year') ?? '');
return $year !== '' ? $year : null;
}
private function nextSchoolYear(string $current): ?string
{
if (!preg_match('/^(\d{4})-(\d{4})$/', $current, $m)) {
if (! preg_match('/^(\d{4})-(\d{4})$/', $current, $m)) {
return null;
}
return ((int) $m[1] + 1) . '-' . ((int) $m[2] + 1);
return ((int) $m[1] + 1).'-'.((int) $m[2] + 1);
}
private function passThreshold(): float
@@ -397,6 +399,7 @@ class PromotionEligibilityService
if ($configured !== null && is_numeric($configured)) {
return (float) $configured;
}
return self::DEFAULT_PASS_THRESHOLD;
}
}