PromptResult.php

Code Hygiene Score: 100

Keine Issues gefunden.

Klassen 1

Funktionen 3

Versionen 1

Code

<?php

declare(strict_types=1);

namespace UseCases\Prompts;

// @responsibility: Ergebnisobjekt für Prompt-Operationen

final class PromptResult
{
    private function __construct(
        public readonly bool $success,
        public readonly ?int $id,
        public readonly string $message,
    ) {
    }

    public static function success(int $id, string $message): self
    {
        return new self(true, $id, $message);
    }

    public static function error(string $message): self
    {
        return new self(false, null, $message);
    }
}
← Übersicht Graph