PHP code example of winzana / functional-event

1. Go to this page and download the library: Download winzana/functional-event library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

winzana / functional-event example snippets




return [   
    Winzana\Core\Event\EventBundle::class => ['all' => true],
];


namespace App\CommandHandler;

use Winzana\Core\Event\Annotation\Event;
use Winzana\Core\Event\Interfaces\EventInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;

/**
 * Class CreateUserCommandHandler
 * @Event()
 */
final class CreateUserCommandHandler implements EventInterface
{
    public function __invoke(GetResponseEvent $event)
    {
        // TODO: Implement __invoke() method.
    }

    public function getEventName(): string
    {
        return 'kernel.request';
    }

    public function getPriority(): int
    {
        return 10;
    }

}