['assigned'], 'assigned' => ['in_progress'], 'in_progress' => ['awaiting_client', 'awaiting_parts', 'completed'], 'awaiting_client' => ['in_progress', 'completed'], 'awaiting_parts' => ['in_progress', 'completed'], 'completed' => ['closed'], 'closed' => [], ]; public function canTransition(string $from, string $to): bool { return in_array($from, self::STATUSES, true) && in_array($to, self::STATUSES, true) && ($from === $to || in_array($to, self::TRANSITIONS[$from], true)); } public function allowedFrom(string $from): array { return in_array($from, self::STATUSES, true) ? array_merge([$from], self::TRANSITIONS[$from]) : []; } }