aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAVACL/Xml
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-12-04 10:25:11 +0000
committerMario <mario@mariovavti.com>2019-12-04 10:25:11 +0000
commitbde429cff649237984903a252ba1a718e6d74f53 (patch)
treeb2b2570159cfb37689e6ce3b96c3b1b988d676cc /vendor/sabre/dav/lib/DAVACL/Xml
parentcc9f41df5f83bcab435d6fb941b5a8f5b1457037 (diff)
parent4c8d33d1eb2a804aa70a7bc677d6c73d0d94816b (diff)
downloadvolse-hubzilla-4.6.tar.gz
volse-hubzilla-4.6.tar.bz2
volse-hubzilla-4.6.zip
Merge branch '4.6RC'4.6
Diffstat (limited to 'vendor/sabre/dav/lib/DAVACL/Xml')
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Property/Acl.php94
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Property/AclRestrictions.php15
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php54
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php82
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php59
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php13
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/ExpandPropertyReport.php27
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalMatchReport.php15
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php31
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php14
10 files changed, 187 insertions, 217 deletions
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Acl.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Acl.php
index 0e1c30ccf..372f62ab3 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Acl.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Acl.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Property;
use Sabre\DAV;
@@ -25,10 +27,10 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Acl implements Element, HtmlOutput {
-
+class Acl implements Element, HtmlOutput
+{
/**
- * List of privileges
+ * List of privileges.
*
* @var array
*/
@@ -43,7 +45,7 @@ class Acl implements Element, HtmlOutput {
protected $prefixBaseUrl;
/**
- * Constructor
+ * Constructor.
*
* This object requires a structure similar to the return value from
* Sabre\DAVACL\Plugin::getACL().
@@ -57,24 +59,22 @@ class Acl implements Element, HtmlOutput {
* will automatically be prefixed.
*
* @param array $privileges
- * @param bool $prefixBaseUrl
+ * @param bool $prefixBaseUrl
*/
- function __construct(array $privileges, $prefixBaseUrl = true) {
-
+ public function __construct(array $privileges, $prefixBaseUrl = true)
+ {
$this->privileges = $privileges;
$this->prefixBaseUrl = $prefixBaseUrl;
-
}
/**
- * Returns the list of privileges for this property
+ * Returns the list of privileges for this property.
*
* @return array
*/
- function getPrivileges() {
-
+ public function getPrivileges()
+ {
return $this->privileges;
-
}
/**
@@ -94,16 +94,12 @@ class Acl implements Element, HtmlOutput {
* If you are opening new elements, you must also close them again.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerialize(Writer $writer) {
-
+ public function xmlSerialize(Writer $writer)
+ {
foreach ($this->privileges as $ace) {
-
$this->serializeAce($writer, $ace);
-
}
-
}
/**
@@ -118,32 +114,33 @@ class Acl implements Element, HtmlOutput {
* be used to construct local links.
*
* @param HtmlOutputHelper $html
+ *
* @return string
*/
- function toHtml(HtmlOutputHelper $html) {
-
+ public function toHtml(HtmlOutputHelper $html)
+ {
ob_start();
- echo "<table>";
- echo "<tr><th>Principal</th><th>Privilege</th><th></th></tr>";
+ echo '<table>';
+ echo '<tr><th>Principal</th><th>Privilege</th><th></th></tr>';
foreach ($this->privileges as $privilege) {
-
echo '<tr>';
// if it starts with a {, it's a special principal
- if ($privilege['principal'][0] === '{') {
+ if ('{' === $privilege['principal'][0]) {
echo '<td>', $html->xmlName($privilege['principal']), '</td>';
} else {
echo '<td>', $html->link($privilege['principal']), '</td>';
}
echo '<td>', $html->xmlName($privilege['privilege']), '</td>';
echo '<td>';
- if (!empty($privilege['protected'])) echo '(protected)';
+ if (!empty($privilege['protected'])) {
+ echo '(protected)';
+ }
echo '</td>';
echo '</tr>';
-
}
- echo "</table>";
- return ob_get_clean();
+ echo '</table>';
+ return ob_get_clean();
}
/**
@@ -165,21 +162,21 @@ class Acl implements Element, HtmlOutput {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$elementMap = [
- '{DAV:}ace' => 'Sabre\Xml\Element\KeyValue',
+ '{DAV:}ace' => 'Sabre\Xml\Element\KeyValue',
'{DAV:}privilege' => 'Sabre\Xml\Element\Elements',
'{DAV:}principal' => 'Sabre\DAVACL\Xml\Property\Principal',
];
$privileges = [];
- foreach ((array)$reader->parseInnerTree($elementMap) as $element) {
-
- if ($element['name'] !== '{DAV:}ace') {
+ foreach ((array) $reader->parseInnerTree($elementMap) as $element) {
+ if ('{DAV:}ace' !== $element['name']) {
continue;
}
$ace = $element['value'];
@@ -190,19 +187,18 @@ class Acl implements Element, HtmlOutput {
$principal = $ace['{DAV:}principal'];
switch ($principal->getType()) {
- case Principal::HREF :
+ case Principal::HREF:
$principal = $principal->getHref();
break;
- case Principal::AUTHENTICATED :
+ case Principal::AUTHENTICATED:
$principal = '{DAV:}authenticated';
break;
- case Principal::UNAUTHENTICATED :
+ case Principal::UNAUTHENTICATED:
$principal = '{DAV:}unauthenticated';
break;
- case Principal::ALL :
+ case Principal::ALL:
$principal = '{DAV:}all';
break;
-
}
$protected = array_key_exists('{DAV:}protected', $ace);
@@ -211,7 +207,7 @@ class Acl implements Element, HtmlOutput {
throw new DAV\Exception\NotImplemented('Every {DAV:}ace element must have a {DAV:}grant element. {DAV:}deny is not yet supported');
}
foreach ($ace['{DAV:}grant'] as $elem) {
- if ($elem['name'] !== '{DAV:}privilege') {
+ if ('{DAV:}privilege' !== $elem['name']) {
continue;
}
@@ -222,34 +218,30 @@ class Acl implements Element, HtmlOutput {
'privilege' => $priv,
];
}
-
}
-
}
return new self($privileges);
-
}
/**
* Serializes a single access control entry.
*
* @param Writer $writer
- * @param array $ace
- * @return void
+ * @param array $ace
*/
- private function serializeAce(Writer $writer, array $ace) {
-
+ private function serializeAce(Writer $writer, array $ace)
+ {
$writer->startElement('{DAV:}ace');
switch ($ace['principal']) {
- case '{DAV:}authenticated' :
+ case '{DAV:}authenticated':
$principal = new Principal(Principal::AUTHENTICATED);
break;
- case '{DAV:}unauthenticated' :
+ case '{DAV:}unauthenticated':
$principal = new Principal(Principal::UNAUTHENTICATED);
break;
- case '{DAV:}all' :
+ case '{DAV:}all':
$principal = new Principal(Principal::ALL);
break;
default:
@@ -271,7 +263,5 @@ class Acl implements Element, HtmlOutput {
}
$writer->endElement(); // ace
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/AclRestrictions.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/AclRestrictions.php
index 8d5854c23..0bf16b431 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/AclRestrictions.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/AclRestrictions.php
@@ -1,12 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Property;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
- * AclRestrictions property
+ * AclRestrictions property.
*
* This property represents {DAV:}acl-restrictions, as defined in RFC3744.
*
@@ -14,8 +16,8 @@ use Sabre\Xml\XmlSerializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class AclRestrictions implements XmlSerializable {
-
+class AclRestrictions implements XmlSerializable
+{
/**
* The xmlSerialize method is called during xml writing.
*
@@ -33,13 +35,10 @@ class AclRestrictions implements XmlSerializable {
* If you are opening new elements, you must also close them again.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerialize(Writer $writer) {
-
+ public function xmlSerialize(Writer $writer)
+ {
$writer->writeElement('{DAV:}grant-only');
$writer->writeElement('{DAV:}no-invert');
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
index 74c09cee1..083856330 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Property;
use Sabre\DAV\Browser\HtmlOutput;
@@ -9,7 +11,7 @@ use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
/**
- * CurrentUserPrivilegeSet
+ * CurrentUserPrivilegeSet.
*
* This class represents the current-user-privilege-set property. When
* requested, it contain all the privileges a user has on a specific node.
@@ -18,26 +20,25 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class CurrentUserPrivilegeSet implements Element, HtmlOutput {
-
+class CurrentUserPrivilegeSet implements Element, HtmlOutput
+{
/**
- * List of privileges
+ * List of privileges.
*
* @var array
*/
private $privileges;
/**
- * Creates the object
+ * Creates the object.
*
* Pass the privileges in clark-notation
*
* @param array $privileges
*/
- function __construct(array $privileges) {
-
+ public function __construct(array $privileges)
+ {
$this->privileges = $privileges;
-
}
/**
@@ -57,19 +58,14 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput {
* If you are opening new elements, you must also close them again.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerialize(Writer $writer) {
-
+ public function xmlSerialize(Writer $writer)
+ {
foreach ($this->privileges as $privName) {
-
$writer->startElement('{DAV:}privilege');
$writer->writeElement($privName);
$writer->endElement();
-
}
-
-
}
/**
@@ -77,12 +73,12 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput {
* list.
*
* @param string $privilegeName
+ *
* @return bool
*/
- function has($privilegeName) {
-
+ public function has($privilegeName)
+ {
return in_array($privilegeName, $this->privileges);
-
}
/**
@@ -90,10 +86,9 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput {
*
* @return array
*/
- function getValue() {
-
+ public function getValue()
+ {
return $this->privileges;
-
}
/**
@@ -115,21 +110,22 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$result = [];
$tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']);
foreach ($tree as $element) {
- if ($element['name'] !== '{DAV:}privilege') {
+ if ('{DAV:}privilege' !== $element['name']) {
continue;
}
$result[] = $element['value'][0];
}
- return new self($result);
+ return new self($result);
}
/**
@@ -144,16 +140,14 @@ class CurrentUserPrivilegeSet implements Element, 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())
);
-
}
-
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php
index 04d22165d..e304a2aed 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Property;
use Sabre\DAV;
@@ -9,7 +11,7 @@ use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
/**
- * Principal property
+ * Principal property.
*
* The principal property represents a principal from RFC3744 (ACL).
* The property can be used to specify a principal or pseudo principals.
@@ -18,30 +20,30 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Principal extends DAV\Xml\Property\Href {
-
+class Principal extends DAV\Xml\Property\Href
+{
/**
- * To specify a not-logged-in user, use the UNAUTHENTICATED principal
+ * To specify a not-logged-in user, use the UNAUTHENTICATED principal.
*/
const UNAUTHENTICATED = 1;
/**
- * To specify any principal that is logged in, use AUTHENTICATED
+ * To specify any principal that is logged in, use AUTHENTICATED.
*/
const AUTHENTICATED = 2;
/**
- * Specific principals can be specified with the HREF
+ * Specific principals can be specified with the HREF.
*/
const HREF = 3;
/**
- * Everybody, basically
+ * Everybody, basically.
*/
const ALL = 4;
/**
- * Principal-type
+ * Principal-type.
*
* Must be one of the UNAUTHENTICATED, AUTHENTICATED or HREF constants.
*
@@ -56,34 +58,31 @@ class Principal extends DAV\Xml\Property\Href {
*
* 'href' is only required for the HREF type.
*
- * @param int $type
+ * @param int $type
* @param string|null $href
*/
- function __construct($type, $href = null) {
-
+ public function __construct($type, $href = null)
+ {
$this->type = $type;
- if ($type === self::HREF && is_null($href)) {
+ if (self::HREF === $type && is_null($href)) {
throw new DAV\Exception('The href argument must be specified for the HREF principal type.');
}
if ($href) {
- $href = rtrim($href, '/') . '/';
+ $href = rtrim($href, '/').'/';
parent::__construct($href);
}
-
}
/**
- * Returns the principal type
+ * Returns the principal type.
*
* @return int
*/
- function getType() {
-
+ public function getType()
+ {
return $this->type;
-
}
-
/**
* The xmlSerialize method is called during xml writing.
*
@@ -101,26 +100,23 @@ class Principal extends DAV\Xml\Property\Href {
* If you are opening new elements, you must also close them again.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerialize(Writer $writer) {
-
+ public function xmlSerialize(Writer $writer)
+ {
switch ($this->type) {
-
- case self::UNAUTHENTICATED :
+ case self::UNAUTHENTICATED:
$writer->writeElement('{DAV:}unauthenticated');
break;
- case self::AUTHENTICATED :
+ case self::AUTHENTICATED:
$writer->writeElement('{DAV:}authenticated');
break;
- case self::HREF :
+ case self::HREF:
parent::xmlSerialize($writer);
break;
- case self::ALL :
+ case self::ALL:
$writer->writeElement('{DAV:}all');
break;
}
-
}
/**
@@ -135,22 +131,21 @@ class Principal extends DAV\Xml\Property\Href {
* be used to construct local links.
*
* @param HtmlOutputHelper $html
+ *
* @return string
*/
- function toHtml(HtmlOutputHelper $html) {
-
+ public function toHtml(HtmlOutputHelper $html)
+ {
switch ($this->type) {
-
- case self::UNAUTHENTICATED :
+ case self::UNAUTHENTICATED:
return '<em>unauthenticated</em>';
- case self::AUTHENTICATED :
+ case self::AUTHENTICATED:
return '<em>authenticated</em>';
- case self::HREF :
+ case self::HREF:
return parent::toHtml($html);
- case self::ALL :
+ case self::ALL:
return '<em>all</em>';
}
-
}
/**
@@ -172,25 +167,24 @@ class Principal extends DAV\Xml\Property\Href {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$tree = $reader->parseInnerTree()[0];
switch ($tree['name']) {
- case '{DAV:}unauthenticated' :
+ case '{DAV:}unauthenticated':
return new self(self::UNAUTHENTICATED);
- case '{DAV:}authenticated' :
+ case '{DAV:}authenticated':
return new self(self::AUTHENTICATED);
case '{DAV:}href':
return new self(self::HREF, $tree['value']);
case '{DAV:}all':
return new self(self::ALL);
- default :
- throw new BadRequest('Unknown or unsupported principal type: ' . $tree['name']);
+ default:
+ throw new BadRequest('Unknown or unsupported principal type: '.$tree['name']);
}
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
index b963cc8c3..1762391d9 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Property;
use Sabre\DAV\Browser\HtmlOutput;
@@ -8,7 +10,7 @@ use Sabre\Xml\Writer;
use Sabre\Xml\XmlSerializable;
/**
- * SupportedPrivilegeSet property
+ * SupportedPrivilegeSet property.
*
* This property encodes the {DAV:}supported-privilege-set property, as defined
* in rfc3744. Please consult the rfc for details about it's structure.
@@ -21,24 +23,23 @@ use Sabre\Xml\XmlSerializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
-
+class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput
+{
/**
- * privileges
+ * privileges.
*
* @var array
*/
protected $privileges;
/**
- * Constructor
+ * Constructor.
*
* @param array $privileges
*/
- function __construct(array $privileges) {
-
+ public function __construct(array $privileges)
+ {
$this->privileges = $privileges;
-
}
/**
@@ -46,10 +47,9 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
*
* @return array
*/
- function getValue() {
-
+ public function getValue()
+ {
return $this->privileges;
-
}
/**
@@ -69,12 +69,10 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
* If you are opening new elements, you must also close them again.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerialize(Writer $writer) {
-
+ public function xmlSerialize(Writer $writer)
+ {
$this->serializePriv($writer, '{DAV:}all', ['aggregates' => $this->privileges]);
-
}
/**
@@ -89,52 +87,49 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
* be used to construct local links.
*
* @param HtmlOutputHelper $html
+ *
* @return string
*/
- function toHtml(HtmlOutputHelper $html) {
-
- $traverse = function($privName, $priv) use (&$traverse, $html) {
- echo "<li>";
+ public function toHtml(HtmlOutputHelper $html)
+ {
+ $traverse = function ($privName, $priv) use (&$traverse, $html) {
+ echo '<li>';
echo $html->xmlName($privName);
if (isset($priv['abstract']) && $priv['abstract']) {
- echo " <i>(abstract)</i>";
+ echo ' <i>(abstract)</i>';
}
if (isset($priv['description'])) {
- echo " " . $html->h($priv['description']);
+ echo ' '.$html->h($priv['description']);
}
if (isset($priv['aggregates'])) {
echo "\n<ul>\n";
foreach ($priv['aggregates'] as $subPrivName => $subPriv) {
$traverse($subPrivName, $subPriv);
}
- echo "</ul>";
+ echo '</ul>';
}
echo "</li>\n";
};
ob_start();
- echo "<ul class=\"tree\">";
+ echo '<ul class="tree">';
$traverse('{DAV:}all', ['aggregates' => $this->getValue()]);
echo "</ul>\n";
return ob_get_clean();
-
}
-
-
/**
- * Serializes a property
+ * Serializes a property.
*
* This is a recursive function.
*
* @param Writer $writer
* @param string $privName
- * @param array $privilege
- * @return void
+ * @param array $privilege
*/
- private function serializePriv(Writer $writer, $privName, $privilege) {
-
+ private function serializePriv(Writer $writer, $privName, $privilege)
+ {
$writer->startElement('{DAV:}supported-privilege');
$writer->startElement('{DAV:}privilege');
@@ -154,7 +149,5 @@ class SupportedPrivilegeSet implements XmlSerializable, HtmlOutput {
}
$writer->endElement(); // supported-privilege
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php b/vendor/sabre/dav/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php
index 0aa2f29a5..17b37afab 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Request/AclPrincipalPropSetReport.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Request;
use Sabre\Xml\Deserializer;
@@ -17,8 +19,8 @@ use Sabre\Xml\XmlDeserializable;
* @author Evert Pot (https://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class AclPrincipalPropSetReport implements XmlDeserializable {
-
+class AclPrincipalPropSetReport implements XmlDeserializable
+{
public $properties = [];
/**
@@ -40,10 +42,11 @@ class AclPrincipalPropSetReport implements XmlDeserializable {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$reader->pushContext();
$reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Deserializer\enum';
@@ -61,7 +64,5 @@ class AclPrincipalPropSetReport implements XmlDeserializable {
}
return $report;
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Request/ExpandPropertyReport.php b/vendor/sabre/dav/lib/DAVACL/Xml/Request/ExpandPropertyReport.php
index a9938ba5b..393308cd2 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Request/ExpandPropertyReport.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Request/ExpandPropertyReport.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Request;
use Sabre\Xml\Reader;
@@ -16,8 +18,8 @@ use Sabre\Xml\XmlDeserializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class ExpandPropertyReport implements XmlDeserializable {
-
+class ExpandPropertyReport implements XmlDeserializable
+{
/**
* An array with requested properties.
*
@@ -51,17 +53,17 @@ class ExpandPropertyReport implements XmlDeserializable {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$elems = $reader->parseInnerTree();
$obj = new self();
$obj->properties = self::traverse($elems);
return $obj;
-
}
/**
@@ -69,15 +71,15 @@ class ExpandPropertyReport implements XmlDeserializable {
* {DAV:}property elements.
*
* @param array $elems
- * @return void
+ *
+ * @return array
*/
- private static function traverse($elems) {
-
+ private static function traverse($elems)
+ {
$result = [];
foreach ($elems as $elem) {
-
- if ($elem['name'] !== '{DAV:}property') {
+ if ('{DAV:}property' !== $elem['name']) {
continue;
}
@@ -85,7 +87,7 @@ class ExpandPropertyReport implements XmlDeserializable {
$elem['attributes']['namespace'] :
'DAV:';
- $propName = '{' . $namespace . '}' . $elem['attributes']['name'];
+ $propName = '{'.$namespace.'}'.$elem['attributes']['name'];
$value = null;
if (is_array($elem['value'])) {
@@ -93,11 +95,8 @@ class ExpandPropertyReport implements XmlDeserializable {
}
$result[$propName] = $value;
-
}
return $result;
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalMatchReport.php b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalMatchReport.php
index 1be15ab2d..f868cc9df 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalMatchReport.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalMatchReport.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Request;
use Sabre\Xml\Deserializer;
@@ -18,8 +20,8 @@ use Sabre\Xml\XmlDeserializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class PrincipalMatchReport implements XmlDeserializable {
-
+class PrincipalMatchReport implements XmlDeserializable
+{
/**
* Report on a list of principals that match the current principal.
*/
@@ -31,7 +33,7 @@ class PrincipalMatchReport implements XmlDeserializable {
const PRINCIPAL_PROPERTY = 2;
/**
- * Must be SELF or PRINCIPAL_PROPERTY
+ * Must be SELF or PRINCIPAL_PROPERTY.
*
* @var int
*/
@@ -71,10 +73,11 @@ class PrincipalMatchReport implements XmlDeserializable {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$reader->pushContext();
$reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Deserializer\enum';
@@ -101,7 +104,5 @@ class PrincipalMatchReport implements XmlDeserializable {
}
return $principalMatch;
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php
index b0cf0e408..26468fd21 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Request;
use Sabre\DAV\Exception\BadRequest;
@@ -18,8 +20,8 @@ use Sabre\Xml\XmlDeserializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class PrincipalPropertySearchReport implements XmlDeserializable {
-
+class PrincipalPropertySearchReport implements XmlDeserializable
+{
/**
* The requested properties.
*
@@ -28,7 +30,7 @@ class PrincipalPropertySearchReport implements XmlDeserializable {
public $properties;
/**
- * searchProperties
+ * searchProperties.
*
* @var array
*/
@@ -72,31 +74,30 @@ class PrincipalPropertySearchReport implements XmlDeserializable {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
$self = new self();
$foundSearchProp = false;
$self->test = 'allof';
- if ($reader->getAttribute('test') === 'anyof') {
+ if ('anyof' === $reader->getAttribute('test')) {
$self->test = 'anyof';
}
$elemMap = [
'{DAV:}property-search' => 'Sabre\\Xml\\Element\\KeyValue',
- '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue',
+ '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue',
];
-
- foreach ($reader->parseInnerTree($elemMap) as $elem) {
+ foreach ($reader->parseInnerTree($elemMap) as $elem) {
switch ($elem['name']) {
-
- case '{DAV:}prop' :
+ case '{DAV:}prop':
$self->properties = array_keys($elem['value']);
break;
- case '{DAV:}property-search' :
+ case '{DAV:}property-search':
$foundSearchProp = true;
// This property has two sub-elements:
// {DAV:}prop - The property to be searched on. This may
@@ -109,19 +110,15 @@ class PrincipalPropertySearchReport implements XmlDeserializable {
$self->searchProperties[$propName] = $elem['value']['{DAV:}match'];
}
break;
- case '{DAV:}apply-to-principal-collection-set' :
+ case '{DAV:}apply-to-principal-collection-set':
$self->applyToPrincipalCollectionSet = true;
break;
-
}
-
}
if (!$foundSearchProp) {
throw new BadRequest('The {DAV:}principal-property-search report must contain at least 1 {DAV:}property-search element');
}
return $self;
-
}
-
}
diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php
index 64d1f7f86..37bc2cfbf 100644
--- a/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php
+++ b/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalSearchPropertySetReport.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL\Xml\Request;
use Sabre\DAV\Exception\BadRequest;
@@ -18,8 +20,8 @@ use Sabre\Xml\XmlDeserializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class PrincipalSearchPropertySetReport implements XmlDeserializable {
-
+class PrincipalSearchPropertySetReport implements XmlDeserializable
+{
/**
* The deserialize method is called during xml parsing.
*
@@ -39,10 +41,11 @@ class PrincipalSearchPropertySetReport implements XmlDeserializable {
* the next element.
*
* @param Reader $reader
+ *
* @return mixed
*/
- static function xmlDeserialize(Reader $reader) {
-
+ public static function xmlDeserialize(Reader $reader)
+ {
if (!$reader->isEmptyElement) {
throw new BadRequest('The {DAV:}principal-search-property-set element must be empty');
}
@@ -51,8 +54,7 @@ class PrincipalSearchPropertySetReport implements XmlDeserializable {
$reader->next();
$self = new self();
- return $self;
+ return $self;
}
-
}