LockTokenMatchesRequestUri.php 958 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\DAV\Exception;
  4. use Sabre\DAV;
  5. /**
  6. * LockTokenMatchesRequestUri.
  7. *
  8. * This exception is thrown by UNLOCK if a supplied lock-token is invalid
  9. *
  10. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  11. * @author Evert Pot (http://evertpot.com/)
  12. * @license http://sabre.io/license/ Modified BSD License
  13. */
  14. class LockTokenMatchesRequestUri extends Conflict
  15. {
  16. /**
  17. * Creates the exception.
  18. */
  19. public function __construct()
  20. {
  21. parent::__construct('The locktoken supplied does not match any locks on this entity');
  22. }
  23. /**
  24. * This method allows the exception to include additional information into the WebDAV error response.
  25. */
  26. public function serialize(DAV\Server $server, \DOMElement $errorNode)
  27. {
  28. $error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:lock-token-matches-request-uri');
  29. $errorNode->appendChild($error);
  30. }
  31. }