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
+23 -16
View File
@@ -2,7 +2,6 @@
namespace App\Models;
use App\Models\BaseModel;
use Illuminate\Support\Facades\DB;
class Homework extends BaseModel
@@ -35,20 +34,20 @@ class Homework extends BaseModel
];
protected $casts = [
'student_id' => 'integer',
'school_id' => 'integer',
'student_id' => 'integer',
'school_id' => 'integer',
'class_section_id' => 'integer',
'updated_by' => 'integer',
'homework_index' => 'integer',
'updated_by' => 'integer',
'homework_index' => 'integer',
// keep numeric; change to 'integer' if your scores are whole numbers
'score' => 'decimal:2',
'max_points' => 'decimal:2',
'locked_by' => 'integer',
'locked_at' => 'datetime',
'score' => 'decimal:2',
'max_points' => 'decimal:2',
'locked_by' => 'integer',
'locked_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/* Optional relationships */
@@ -93,10 +92,18 @@ class Homework extends BaseModel
foreach ($rows as $r) {
$score = $r->score ?? null;
if ($score === null) continue;
if (is_string($score) && trim($score) === '') continue;
if ($score === '') continue;
if (!is_numeric($score)) continue;
if ($score === null) {
continue;
}
if (is_string($score) && trim($score) === '') {
continue;
}
if ($score === '') {
continue;
}
if (! is_numeric($score)) {
continue;
}
$total += (float) $score;
$count++;
@@ -108,4 +115,4 @@ class Homework extends BaseModel
return round($total / $count, 2);
}
}
}