Skip to content

Instantly share code, notes, and snippets.

@ismail1432
Last active October 2, 2022 12:53
Show Gist options
  • Select an option

  • Save ismail1432/24d84e6ca3739c54c1a32e5040f44ee2 to your computer and use it in GitHub Desktop.

Select an option

Save ismail1432/24d84e6ca3739c54c1a32e5040f44ee2 to your computer and use it in GitHub Desktop.
<?php
// PreHandlerInterface.php
interface PreHandlerInterface
{
/**
* Should contains what you want to do before handling the message
*/
public function preHandle(object $message);
/**
* Returns if the class should call `preHandle` for this message.
*/
public function supports(object $message): bool;
}
// PostHandlerInterface.php
interface PostHandlerInterface
{
/**
* Contains what you want to do after the message is handled.
* $result contains the return of the handler
*/
public function postHandle(object $message, $result);
/**
* Return if the class should call `postHandle` for this message.
*/
public function supports(object $message): bool;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment