diff options
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php')
-rw-r--r-- | vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php b/vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php index 550360e5a..20d8a2a30 100644 --- a/vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php +++ b/vendor/sabre/dav/lib/DAV/Exception/PreconditionFailed.php @@ -1,11 +1,13 @@ <?php +declare(strict_types=1); + namespace Sabre\DAV\Exception; use Sabre\DAV; /** - * PreconditionFailed + * PreconditionFailed. * * This exception is normally thrown when a client submitted a conditional request, * like for example an If, If-None-Match or If-Match header, which caused the HTTP @@ -15,8 +17,8 @@ use Sabre\DAV; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class PreconditionFailed extends DAV\Exception { - +class PreconditionFailed extends DAV\Exception +{ /** * When this exception is thrown, the header-name might be set. * @@ -28,44 +30,39 @@ class PreconditionFailed extends DAV\Exception { public $header = null; /** - * Create the exception + * Create the exception. * * @param string $message * @param string $header */ - function __construct($message, $header = null) { - + public function __construct($message, $header = null) + { parent::__construct($message); $this->header = $header; - } /** - * Returns the HTTP statuscode for this exception + * Returns the HTTP statuscode for this exception. * * @return int */ - function getHTTPCode() { - + public function getHTTPCode() + { return 412; - } /** - * This method allows the exception to include additional information into the WebDAV error response + * This method allows the exception to include additional information into the WebDAV error response. * - * @param DAV\Server $server + * @param DAV\Server $server * @param \DOMElement $errorNode - * @return void */ - function serialize(DAV\Server $server, \DOMElement $errorNode) { - + public function serialize(DAV\Server $server, \DOMElement $errorNode) + { if ($this->header) { $prop = $errorNode->ownerDocument->createElement('s:header'); $prop->nodeValue = $this->header; $errorNode->appendChild($prop); } - } - } |