InvalidValueException.php 604 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Notification;
  8. /**
  9. * @since 30.0.0
  10. */
  11. class InvalidValueException extends \InvalidArgumentException {
  12. /**
  13. * @since 30.0.0
  14. */
  15. public function __construct(
  16. protected string $field,
  17. ?\Throwable $previous = null,
  18. ) {
  19. parent::__construct('Value provided for ' . $field . ' is not valid', previous: $previous);
  20. }
  21. /**
  22. * @since 30.0.0
  23. */
  24. public function getFieldIdentifier(): string {
  25. return $this->field;
  26. }
  27. }