TenantAtlas/apps/platform/app/Services/TenantConfiguration/ExchangePowerShellGateResult.php
ahmido f4e342121a feat: add Exchange PowerShell production runner gate (#499)
Spec 432: Exchange PowerShell production runner boundary and runtime gate. Validation: php artisan test --filter=Spec432 --compact; ./vendor/bin/pint --dirty --test --format agent; git diff --check.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #499
2026-07-07 18:34:18 +00:00

42 lines
1023 B
PHP

<?php
declare(strict_types=1);
namespace App\Services\TenantConfiguration;
final readonly class ExchangePowerShellGateResult
{
/**
* @param array<string, mixed> $context
*/
private function __construct(
public bool $allowed,
public ?string $reasonCode = null,
public ?string $failureCode = null,
public ?string $message = null,
public array $context = [],
) {}
/**
* @param array<string, mixed> $context
*/
public static function allowed(array $context = []): self
{
return new self(allowed: true, context: $context);
}
/**
* @param array<string, mixed> $context
*/
public static function blocked(string $reasonCode, string $failureCode, string $message, array $context = []): self
{
return new self(
allowed: false,
reasonCode: $reasonCode,
failureCode: $failureCode,
message: $message,
context: $context,
);
}
}