NotificationHookInterface.php 625 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Module\Notification\Contracts;
  3. interface NotificationHookInterface
  4. {
  5. /**
  6. * 发送前钩子
  7. *
  8. * @param array $data
  9. * @return array
  10. */
  11. public function beforeSend(array $data): array;
  12. /**
  13. * 发送后钩子
  14. *
  15. * @param array $data
  16. * @param bool $result
  17. * @return void
  18. */
  19. public function afterSend(array $data, bool $result): void;
  20. /**
  21. * 发送失败钩子
  22. *
  23. * @param array $data
  24. * @param \Exception $exception
  25. * @return void
  26. */
  27. public function onError(array $data, \Exception $exception): void;
  28. }