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
@@ -14,9 +14,10 @@ class StickerPresetService
];
return array_map(static function (array $row): array {
$row['title'] = $row['title'] ?? ($row['label'] ?? ($row['value'] . ' mm'));
$row['title'] = $row['title'] ?? ($row['label'] ?? ($row['value'].' mm'));
$row['text'] = $row['text'] ?? $row['title'];
$row['per_page'] = $row['per_page'] ?? ($row['ppg'] ?? null);
return $row;
}, $rows);
}
@@ -6,9 +6,7 @@ use Illuminate\Support\Facades\Log;
class StickerPrintService
{
public function __construct(private StickerQueryService $queryService)
{
}
public function __construct(private StickerQueryService $queryService) {}
public function generate(array $payload): array
{
@@ -23,7 +21,7 @@ class StickerPrintService
if ($studentId > 0) {
$student = $this->queryService->findStudent($studentId);
if (!$student) {
if (! $student) {
return ['ok' => false, 'message' => 'Student not found.'];
}
$students = [$student];
@@ -102,7 +100,7 @@ class StickerPrintService
$minPt = 8;
$hPad = 2;
$fullName = trim(($student['firstname'] ?? '') . ' ' . ($student['lastname'] ?? '')) ?: 'Student';
$fullName = trim(($student['firstname'] ?? '').' '.($student['lastname'] ?? '')) ?: 'Student';
$bestPt = $maxPt;
$textW = 0.0;
@@ -158,6 +156,7 @@ class StickerPrintService
for ($k = 0; $k < $qty; $k++) {
$printList[] = $students[0];
}
return $printList;
}
@@ -221,19 +220,19 @@ class StickerPrintService
|| (abs($stickerWidth - 100.0) < 0.6 && abs($stickerHeight - 24.5) < 0.6);
if ($isXSmallPreset) {
if (!$marginLeftProvided) {
if (! $marginLeftProvided) {
$marginLeft = 4.0;
if (!$marginRightProvided) {
if (! $marginRightProvided) {
$marginRight = 4.0;
}
}
if (!$marginRightProvided && $marginRight < 4.0) {
if (! $marginRightProvided && $marginRight < 4.0) {
$marginRight = 4.0;
}
if (!$gapXProvided) {
if (! $gapXProvided) {
$gapX = 0.0;
}
if (!$gapYProvided) {
if (! $gapYProvided) {
$gapY = 0.0;
}
}
@@ -6,9 +6,7 @@ use Illuminate\Support\Facades\DB;
class StickerQueryService
{
public function __construct(private StickerContextService $context)
{
}
public function __construct(private StickerContextService $context) {}
public function resolveSchoolYear(?string $schoolYear): string
{
@@ -108,7 +106,8 @@ class StickerQueryService
if ($sectionName === '') {
return false;
}
return !preg_match('/^(youth|kg)(?:\b|-)/i', $sectionName);
return ! preg_match('/^(youth|kg)(?:\b|-)/i', $sectionName);
}));
}
}