aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php')
-rw-r--r--vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php53
1 files changed, 25 insertions, 28 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php b/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
index ce640ff32..ce07d4382 100644
--- a/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
+++ b/vendor/sabre/dav/lib/DAV/Xml/Property/ResourceType.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAV\Xml\Property;
use Sabre\DAV\Browser\HtmlOutput;
@@ -8,7 +10,7 @@ use Sabre\Xml\Element;
use Sabre\Xml\Reader;
/**
- * {DAV:}resourcetype property
+ * {DAV:}resourcetype property.
*
* This class represents the {DAV:}resourcetype property, as defined in:
*
@@ -18,10 +20,10 @@ use Sabre\Xml\Reader;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class ResourceType extends Element\Elements implements HtmlOutput {
-
+class ResourceType extends Element\Elements implements HtmlOutput
+{
/**
- * Constructor
+ * Constructor.
*
* You can either pass null (for no resourcetype), a string (for a single
* resourcetype) or an array (for multiple).
@@ -30,48 +32,44 @@ class ResourceType extends Element\Elements implements HtmlOutput {
*
* @param array|string|null $resourceTypes
*/
- function __construct($resourceTypes = null) {
-
- parent::__construct((array)$resourceTypes);
-
+ public function __construct($resourceTypes = null)
+ {
+ parent::__construct((array) $resourceTypes);
}
/**
- * Returns the values in clark-notation
+ * Returns the values in clark-notation.
*
* For example array('{DAV:}collection')
*
* @return array
*/
- function getValue() {
-
+ public function getValue()
+ {
return $this->value;
-
}
/**
- * Checks if the principal contains a certain value
+ * Checks if the principal contains a certain value.
*
* @param string $type
+ *
* @return bool
*/
- function is($type) {
-
+ public function is($type)
+ {
return in_array($type, $this->value);
-
}
/**
- * Adds a resourcetype value to this property
+ * Adds a resourcetype value to this property.
*
* @param string $type
- * @return void
*/
- function add($type) {
-
+ public function add($type)
+ {
$this->value[] = $type;
$this->value = array_unique($this->value);
-
}
/**
@@ -93,13 +91,13 @@ class ResourceType extends Element\Elements implements HtmlOutput {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
return
new self(parent::xmlDeserialize($reader));
-
}
/**
@@ -114,15 +112,14 @@ class ResourceType extends Element\Elements implements HtmlOutput {
* be used to construct local links.
*
* @param HtmlOutputHelper $html
+ *
* @return string
*/
- function toHtml(HtmlOutputHelper $html) {
-
+ public function toHtml(HtmlOutputHelper $html)
+ {
return implode(
', ',
array_map([$html, 'xmlName'], $this->getValue())
);
-
}
-
}