TagNotFoundException.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Vincent Petry <vincent@nextcloud.com>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP\SystemTag;
  27. /**
  28. * Exception when a tag was not found.
  29. *
  30. * @since 9.0.0
  31. */
  32. class TagNotFoundException extends \RuntimeException {
  33. /** @var string[] */
  34. protected $tags;
  35. /**
  36. * TagNotFoundException constructor.
  37. *
  38. * @param string $message
  39. * @param int $code
  40. * @param \Exception|null $previous
  41. * @param string[] $tags
  42. * @since 9.0.0
  43. */
  44. public function __construct(string $message = '', int $code = 0, \Exception $previous = null, array $tags = []) {
  45. parent::__construct($message, $code, $previous);
  46. $this->tags = $tags;
  47. }
  48. /**
  49. * @return string[]
  50. * @since 9.0.0
  51. */
  52. public function getMissingTags(): array {
  53. return $this->tags;
  54. }
  55. }