Last active
October 2, 2022 12:53
-
-
Save ismail1432/24d84e6ca3739c54c1a32e5040f44ee2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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