Fix Laravel Pint formatting

This commit is contained in:
root
2026-06-09 00:03:03 -04:00
parent 8d4d610b82
commit b5fd4a4ca1
1414 changed files with 11317 additions and 10201 deletions
+11 -10
View File
@@ -67,7 +67,7 @@ class FamilyMutationService
}
$familyId = $this->familyIdFromStudentPrimary($studentId);
if (!$familyId) {
if (! $familyId) {
return ['ok' => false, 'message' => 'No primary family found for this student'];
}
@@ -83,13 +83,13 @@ class FamilyMutationService
}
$familyId = $this->familyIdFromStudentPrimary($studentId);
if (!$familyId) {
if (! $familyId) {
return ['ok' => false, 'message' => 'No primary family found for this student'];
}
return DB::transaction(function () use ($email, $firstname, $lastname, $relation, $familyId) {
$user = User::query()->where('email', $email)->first();
if (!$user) {
if (! $user) {
$user = User::query()->create([
'firstname' => (string) ($firstname ?? ''),
'lastname' => (string) ($lastname ?? ''),
@@ -167,7 +167,7 @@ class FamilyMutationService
{
$legacyTable = 'parents';
$this->ensureTablesExist(['families', 'family_students', 'family_guardians']);
if (!Schema::hasTable($legacyTable)) {
if (! Schema::hasTable($legacyTable)) {
return ['ok' => false, 'message' => "Legacy table '{$legacyTable}' not found"];
}
@@ -192,6 +192,7 @@ class FamilyMutationService
if ($firstId <= 0 || ($secondId <= 0 && $email === '')) {
$skipped++;
continue;
}
@@ -203,7 +204,7 @@ class FamilyMutationService
$userId = $secondId;
} else {
$user = User::query()->where('email', $email)->first();
if (!$user) {
if (! $user) {
$user = User::query()->create([
'firstname' => (string) ($r['firstname'] ?? ''),
'lastname' => (string) ($r['lastname'] ?? ''),
@@ -251,7 +252,7 @@ class FamilyMutationService
private function ensureFamilyForPrimaryParent(int $primaryUserId, int &$createdCounter): int
{
$code = 'FAM-' . $primaryUserId;
$code = 'FAM-'.$primaryUserId;
$row = Family::query()->where('family_code', $code)->first();
if ($row) {
return (int) $row->id;
@@ -259,7 +260,7 @@ class FamilyMutationService
$family = Family::query()->create([
'family_code' => $code,
'household_name' => 'Family of User ' . $primaryUserId,
'household_name' => 'Family of User '.$primaryUserId,
'is_active' => 1,
]);
$createdCounter++;
@@ -309,11 +310,11 @@ class FamilyMutationService
private function familyIdFromStudentPrimary(int $studentId): ?int
{
$student = Student::query()->select('parent_id')->find($studentId);
if (!$student || empty($student->parent_id)) {
if (! $student || empty($student->parent_id)) {
return null;
}
$code = 'FAM-' . (int) $student->parent_id;
$code = 'FAM-'.(int) $student->parent_id;
$row = Family::query()->select('id')->where('family_code', $code)->first();
if ($row) {
return (int) $row->id;
@@ -331,7 +332,7 @@ class FamilyMutationService
private function ensureTablesExist(array $tables): void
{
foreach ($tables as $table) {
if (!Schema::hasTable($table)) {
if (! Schema::hasTable($table)) {
Log::warning('Family tables missing', ['table' => $table]);
throw new \RuntimeException("Missing required table '{$table}'. Run migrations.");
}