thesis/message

Thesis Message

0.2.0 2025-04-02 20:15 UTC

This package is auto-updated.

Last update: 2025-04-02 20:48:16 UTC


README

PHP Version Requirement GitHub Release

This package provides two marker interfaces for messaging: Message and Event.

Installation

composer require thesis/message

Usage

use Thesis\Message\Message;
use Thesis\Message\Event;

final readonly class RegisterUser implements Message
{
    public function __construct(
        public Uuid $userId,
        public string $name,
    ) {}
}

final readonly class UserRegistered implements Event
{
    public function __construct(
        public Uuid $userId,
    ) {}
}

/**
 * @implements Message<string>
 */
final readonly class GetUserName implements Message
{
    public function __construct(
        public Uuid $userId,
    ) {}
}