feat: add MatchActionSupport for shared CSRF/turn/state verification

This commit is contained in:
Keith Solomon
2026-07-26 00:36:49 -05:00
parent b444f98aa0
commit 47dc95fa56
3 changed files with 278 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace BattleForge\Http;
use BattleForge\Domain\MatchState;
/**
* @phpstan-type MatchIdAndMatch = array{matchId: string, match: MatchState}
*/
final readonly class MatchActionResult
{
/**
* @param ?MatchIdAndMatch $matchIdAndMatch
*/
public function __construct(
public ?Response $response,
public ?array $matchIdAndMatch,
) {
}
/** @param MatchIdAndMatch $pair */
public static function ok(array $pair): self
{
return new self(null, $pair);
}
public static function reject(Response $response): self
{
return new self($response, null);
}
}