16 lines
389 B
PHP
16 lines
389 B
PHP
<?php
|
|
|
|
namespace App\Game;
|
|
|
|
/**
|
|
* A refused intent. `reason` is a stable code the client translates
|
|
* (errors.<reason>), the message is a fallback for people reading logs.
|
|
*/
|
|
final class GameRuleViolation extends \RuntimeException
|
|
{
|
|
public function __construct(public readonly string $reason, ?string $message = null)
|
|
{
|
|
parent::__construct($message ?? $reason);
|
|
}
|
|
}
|