ChatSessionResult.php

Code Hygiene Score: 100

Keine Issues gefunden.

Klassen 1

Funktionen 3

Versionen 1

Code

<?php

declare(strict_types=1);

namespace UseCases\Chat;

// @responsibility: Ergebnisobjekt für Chat-Session-Operationen

final class ChatSessionResult
{
    private function __construct(
        public readonly bool $success,
        public readonly string $message,
    ) {
    }

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

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