You've already forked Php-Template
chore: add deployment configurations and tests for logger and dispatcher
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
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
This commit is contained in:
36
src/Attributes/Async/HandlesMessage.php
Normal file
36
src/Attributes/Async/HandlesMessage.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user