aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAV/Collection.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/lib/DAV/Collection.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/lib/DAV/Collection.php')
-rw-r--r--vendor/sabre/dav/lib/DAV/Collection.php59
1 files changed, 28 insertions, 31 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Collection.php b/vendor/sabre/dav/lib/DAV/Collection.php
index 35c90b5af..2728bb27e 100644
--- a/vendor/sabre/dav/lib/DAV/Collection.php
+++ b/vendor/sabre/dav/lib/DAV/Collection.php
@@ -1,9 +1,11 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAV;
/**
- * Collection class
+ * Collection class.
*
* This is a helper class, that should aid in getting collections classes setup.
* Most of its methods are implemented, and throw permission denied exceptions
@@ -12,8 +14,8 @@ namespace Sabre\DAV;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-abstract class Collection extends Node implements ICollection {
-
+abstract class Collection extends Node implements ICollection
+{
/**
* Returns a child object, by its name.
*
@@ -25,18 +27,19 @@ abstract class Collection extends Node implements ICollection {
* exist.
*
* @param string $name
+ *
* @throws Exception\NotFound
+ *
* @return INode
*/
- function getChild($name) {
-
+ public function getChild($name)
+ {
foreach ($this->getChildren() as $child) {
-
- if ($child->getName() === $name) return $child;
-
+ if ($child->getName() === $name) {
+ return $child;
+ }
}
- throw new Exception\NotFound('File not found: ' . $name);
-
+ throw new Exception\NotFound('File not found: '.$name);
}
/**
@@ -45,25 +48,22 @@ abstract class Collection extends Node implements ICollection {
* It is generally a good idea to try and override this. Usually it can be optimized.
*
* @param string $name
+ *
* @return bool
*/
- function childExists($name) {
-
+ public function childExists($name)
+ {
try {
-
$this->getChild($name);
- return true;
+ return true;
} catch (Exception\NotFound $e) {
-
return false;
-
}
-
}
/**
- * Creates a new file in the directory
+ * Creates a new file in the directory.
*
* Data will either be supplied as a stream resource, or in certain cases
* as a string. Keep in mind that you may have to support either.
@@ -82,28 +82,25 @@ abstract class Collection extends Node implements ICollection {
* return the same contents of what was submitted here, you are strongly
* recommended to omit the ETag.
*
- * @param string $name Name of the file
+ * @param string $name Name of the file
* @param resource|string $data Initial payload
- * @return null|string
+ *
+ * @return string|null
*/
- function createFile($name, $data = null) {
-
- throw new Exception\Forbidden('Permission denied to create file (filename ' . $name . ')');
-
+ public function createFile($name, $data = null)
+ {
+ throw new Exception\Forbidden('Permission denied to create file (filename '.$name.')');
}
/**
- * Creates a new subdirectory
+ * Creates a new subdirectory.
*
* @param string $name
+ *
* @throws Exception\Forbidden
- * @return void
*/
- function createDirectory($name) {
-
+ public function createDirectory($name)
+ {
throw new Exception\Forbidden('Permission denied to create directory');
-
}
-
-
}