Files
fotospiel-app/app/Services/AiEditing/Safety/AiSafetyDecision.php
Codex Agent 36bed12ff9
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
feat: implement AI styling foundation and billing scope rework
2026-02-06 20:01:58 +01:00

40 lines
993 B
PHP

<?php
namespace App\Services\AiEditing\Safety;
class AiSafetyDecision
{
/**
* @param array<int, string> $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<int, string> $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,
);
}
}