24 lines
622 B
PHP
24 lines
622 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Lubian\AttributeMagic\Handler;
|
|
|
|
use Lubian\AttributeMagic\Infrastructure\Event\Dispatcher;
|
|
use Lubian\AttributeMagic\Infrastructure\Route\AsHandler;
|
|
use Lubian\AttributeMagic\Infrastructure\Route\HttpMethod;
|
|
use Lubian\AttributeMagic\Listener\LauschEvent;
|
|
|
|
final readonly class Lol
|
|
{
|
|
public function __construct(
|
|
private Dispatcher $dispatcher
|
|
) {
|
|
}
|
|
|
|
#[AsHandler(HttpMethod::GET, '/')]
|
|
public function lol(): void
|
|
{
|
|
$event = new LauschEvent('aaaaaaaalso');
|
|
$this->dispatcher->dispatch($event);
|
|
echo $event->message;
|
|
}
|
|
}
|