fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -15,7 +15,9 @@ use RuntimeException;
*/
class PromotionStatusService
{
public function __construct(private PromotionAuditService $audit) {}
public function __construct(private PromotionAuditService $audit)
{
}
/**
* Map of allowed transitions from current → set of next statuses.
@@ -78,11 +80,10 @@ class PromotionStatusService
if ($from === $to) {
return true;
}
if (! in_array($to, StudentPromotionRecord::ALL_STATUSES, true)) {
if (!in_array($to, StudentPromotionRecord::ALL_STATUSES, true)) {
return false;
}
$allowed = self::ALLOWED_TRANSITIONS[$from] ?? [];
return in_array($to, $allowed, true);
}
@@ -97,7 +98,7 @@ class PromotionStatusService
?int $userId = null,
?string $notes = null
): StudentPromotionRecord {
if (! in_array($newStatus, StudentPromotionRecord::ALL_STATUSES, true)) {
if (!in_array($newStatus, StudentPromotionRecord::ALL_STATUSES, true)) {
throw new InvalidArgumentException(sprintf('Unknown promotion status "%s".', $newStatus));
}
@@ -105,7 +106,7 @@ class PromotionStatusService
if ($oldStatus === $newStatus) {
return $record;
}
if (! $this->canTransition($oldStatus, $newStatus)) {
if (!$this->canTransition($oldStatus, $newStatus)) {
throw new RuntimeException(sprintf(
'Transition from "%s" to "%s" is not allowed.',
$oldStatus,
@@ -134,7 +135,7 @@ class PromotionStatusService
?int $userId = null,
?string $notes = null
): StudentPromotionRecord {
if (! in_array($newStatus, StudentPromotionRecord::ALL_STATUSES, true)) {
if (!in_array($newStatus, StudentPromotionRecord::ALL_STATUSES, true)) {
throw new InvalidArgumentException(sprintf('Unknown promotion status "%s".', $newStatus));
}