PHP code example of blacksmith-project / event-bus
1. Go to this page and download the library: Download blacksmith-project/event-bus 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/ */
blacksmith-project / event-bus example snippets
public function __construct(EventBus $eventBus)
{
$this->eventBus = $eventBus
}
public function handle(DoSomething $doSomething): void
{
// do business logic
$event = new SomethingDone();
$this->eventBus->send($event);
}