aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php')
-rw-r--r--vendor/sabre/dav/lib/DAVACL/Xml/Request/PrincipalPropertySearchReport.php31
1 files changed, 14 insertions, 17 deletions
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;
-
}
-
}