add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 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));
}