aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-11-10 12:49:51 +0000
committerMario <mario@mariovavti.com>2019-11-10 14:10:03 +0100
commit580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch)
tree82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php
parentd22766f458a8539a40a57f3946459a9be1f21cd6 (diff)
downloadvolse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2
volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php79
1 files changed, 34 insertions, 45 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php
index eff1e7d67..72fdb5ec8 100644
--- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php
+++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/FileMock.php
@@ -1,20 +1,21 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAV\PartialUpdate;
use Sabre\DAV;
-class FileMock implements IPatchSupport {
-
+class FileMock implements IPatchSupport
+{
protected $data = '';
- function put($str) {
-
+ public function put($str)
+ {
if (is_resource($str)) {
$str = stream_get_contents($str);
}
$this->data = $str;
-
}
/**
@@ -40,83 +41,71 @@ class FileMock implements IPatchSupport {
* time.
*
* @param resource|string $data
- * @param int $rangeType
- * @param int $offset
+ * @param int $rangeType
+ * @param int $offset
+ *
* @return string|null
*/
- function patch($data, $rangeType, $offset = null) {
-
+ public function patch($data, $rangeType, $offset = null)
+ {
if (is_resource($data)) {
$data = stream_get_contents($data);
}
switch ($rangeType) {
-
- case 1 :
+ case 1:
$this->data .= $data;
break;
- case 3 :
+ case 3:
// Turn the offset into an offset-offset.
$offset = strlen($this->data) - $offset;
- // No break is intentional
- case 2 :
+ // no break is intentional
+ case 2:
$this->data =
- substr($this->data, 0, $offset) .
- $data .
+ substr($this->data, 0, $offset).
+ $data.
substr($this->data, $offset + strlen($data));
break;
-
}
-
}
- function get() {
-
+ public function get()
+ {
return $this->data;
-
}
- function getContentType() {
-
+ public function getContentType()
+ {
return 'text/plain';
-
}
- function getSize() {
-
+ public function getSize()
+ {
return strlen($this->data);
-
}
- function getETag() {
-
- return '"' . $this->data . '"';
-
+ public function getETag()
+ {
+ return '"'.$this->data.'"';
}
- function delete() {
-
+ public function delete()
+ {
throw new DAV\Exception\MethodNotAllowed();
-
}
- function setName($name) {
-
+ public function setName($name)
+ {
throw new DAV\Exception\MethodNotAllowed();
-
}
- function getName() {
-
+ public function getName()
+ {
return 'partial';
-
}
- function getLastModified() {
-
+ public function getLastModified()
+ {
return null;
-
}
-
-
}