https://github.com/thesis-php/message
https://github.com/thesis-php/message
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thesis-php/message
- Owner: thesis-php
- License: mit
- Created: 2024-05-20T09:21:46.000Z (about 2 years ago)
- Default Branch: 0.4.x
- Last Pushed: 2025-07-16T23:54:05.000Z (11 months ago)
- Last Synced: 2025-10-17T07:16:55.123Z (8 months ago)
- Language: PHP
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Thesis Message
[](https://packagist.org/packages/thesis/message)
[](https://github.com/thesisphp/message/releases)
This package provides four interfaces for messaging: [`Message`](src/Message.php), [`Command`](src/Command.php), [`Event`](src/Event.php) and [`Call`](src/Call.php).
## Installation
```shell
composer require thesis/message
```
## Usage
```php
use Thesis\Message\Call;
use Thesis\Message\Command;
use Thesis\Message\Event;
final readonly class RegisterUser implements Command
{
public function __construct(
public Uuid $userId,
public string $name,
) {}
}
final readonly class UserRegistered implements Event
{
public function __construct(
public Uuid $userId,
) {}
}
/**
* @implements Call
*/
final readonly class GetUserName implements Call
{
public function __construct(
public Uuid $userId,
) {}
}
```