$reasonCodes */ public function __construct( public readonly bool $blocked, public readonly string $state, public readonly array $reasonCodes = [], public readonly ?string $failureCode = null, public readonly ?string $failureMessage = null, ) {} public static function passed(): self { return new self( blocked: false, state: 'passed', ); } /** * @param array $reasonCodes */ public static function blocked(array $reasonCodes, string $failureCode, string $failureMessage): self { return new self( blocked: true, state: 'blocked', reasonCodes: array_values(array_unique($reasonCodes)), failureCode: $failureCode, failureMessage: $failureMessage, ); } }