feat: add event dispatcher facade and service provider
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 1m34s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 1m45s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m51s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m42s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m50s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 1m17s

This commit is contained in:
2025-11-11 10:58:46 -05:00
parent d7a2faf3a8
commit 291f6ced87
3 changed files with 58 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\App\Services\Facades;
use Siteworxpro\App\Events\Dispatcher as DispatcherConcrete;
use Siteworxpro\App\Services\Facade;
/**
* Class Dispatcher
*
* A facade for the event dispatcher.
*
* @package Siteworxpro\App\Services\Facades
*
* @method static void listen(string $event, callable|string $listener)
* @method static void dispatch(object|string $event, array $payload = [], bool $halt = false)
* @method static void push(object|string $event, array $payload = [])
* @method static array|null until(object|string $event, array $payload = [])
* @method static bool hasListeners(string $eventName)
* @method static void subscribe(mixed $subscriber)
*/
class Dispatcher extends Facade
{
/**
* Get the registered name of the component.
*
* @return string The name of the component.
*/
protected static function getFacadeAccessor(): string
{
return DispatcherConcrete::class;
}
}