Files
Php-Template/src/Attributes/Async/HandlesMessage.php
Ron Rise 4bc6f5251a
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 4m18s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 4m30s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 4m21s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 4m35s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 4m21s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 3m13s
chore: add deployment configurations and tests for logger and dispatcher
2025-11-14 13:01:02 -05:00

37 lines
830 B
PHP

<?php
declare(strict_types=1);
namespace Siteworxpro\App\Attributes\Async;
use Attribute;
/**
* Attribute to mark a class as a handler for a specific message class in an async workflow.
*
* Repeatable: attach multiple times to handle multiple message classes.
*/
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
readonly class HandlesMessage
{
/**
* Create a new HandlesMessage attribute.
*
* @param class-string $messageClass Fully-qualified class name of the message handled.
*/
public function __construct(
public string $messageClass,
) {
}
/**
* Get the fully-qualified message class this handler processes.
*
* @return class-string
*/
public function getMessageClass(): string
{
return $this->messageClass;
}
}