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
@@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Log;
class DiscountApplyService
{
private DiscountContextService $context;
private DiscountInvoiceService $invoiceService;
public function __construct(DiscountContextService $context, DiscountInvoiceService $invoiceService)
@@ -24,7 +25,7 @@ class DiscountApplyService
$semester = $this->context->getSemester();
$voucher = DiscountVoucher::query()->find($voucherId);
if (!$voucher) {
if (! $voucher) {
return ['ok' => false, 'message' => 'Voucher not found.'];
}
@@ -43,7 +44,7 @@ class DiscountApplyService
return ['ok' => false, 'message' => 'This voucher has reached its maximum allowed uses.'];
}
if (!$allowAdditional) {
if (! $allowAdditional) {
$rows = DB::table('discount_usages as du')
->select('i.parent_id')
->join('invoices as i', 'i.id', '=', 'du.invoice_id')
@@ -55,7 +56,7 @@ class DiscountApplyService
->all();
$blockedParentIds = array_map(static fn ($r) => (int) ($r['parent_id'] ?? 0), $rows);
if (!empty($blockedParentIds)) {
if (! empty($blockedParentIds)) {
$parentIds = array_values(array_diff(array_map('intval', $parentIds), $blockedParentIds));
}
if (empty($parentIds)) {
@@ -81,6 +82,7 @@ class DiscountApplyService
'parent_id' => (int) $parentId,
'voucher_id' => $voucherId,
]);
continue;
}
@@ -99,7 +101,7 @@ class DiscountApplyService
continue;
}
if (!$allowAdditional) {
if (! $allowAdditional) {
$exists = DB::table('discount_usages as du')
->join('invoices as i', 'du.invoice_id', '=', 'i.id')
->where('du.voucher_id', $voucherId)
@@ -197,6 +199,7 @@ class DiscountApplyService
DB::commit();
} catch (\Throwable $e) {
DB::rollBack();
return ['ok' => false, 'message' => 'Voucher application failed. Transaction rolled back.'];
}
@@ -286,7 +289,7 @@ class DiscountApplyService
event('paymentReceived', [$eventData, $studentData]);
}
} catch (\Throwable $e) {
Log::warning('paymentReceived hook failed: ' . $e->getMessage());
Log::warning('paymentReceived hook failed: '.$e->getMessage());
}
}
}