1
0

IDismissableNotifier.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Notification;
  8. /**
  9. * Interface INotifier classes should implement if they want to process notifications
  10. * that are dismissed by the user.
  11. *
  12. * This can be useful if dismissing the notification will leave it in an incomplete
  13. * state. The handler can choose to for example do some default action.
  14. *
  15. * @since 18.0.0
  16. */
  17. interface IDismissableNotifier extends INotifier {
  18. /**
  19. * @param INotification $notification
  20. * @throws UnknownNotificationException when the notifier is not in charge of the notification
  21. *
  22. * @since 18.0.0
  23. * @since 30.0.0 Notifiers should throw {@see UnknownNotificationException} instead of \InvalidArgumentException
  24. * when they did not handle the notification. Throwing \InvalidArgumentException directly is deprecated and will
  25. * be logged as an error in Nextcloud 39.
  26. */
  27. public function dismissNotification(INotification $notification): void;
  28. }