thesis/message

Thesis Message

0.2.1 2025-04-04 04:36 UTC

This package is auto-updated.

Last update: 2025-04-04 04:37:35 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,
    ) {}
}