diff options
author | Mario <mario@mariovavti.com> | 2019-11-10 12:49:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-10 14:10:03 +0100 |
commit | 580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch) | |
tree | 82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php | |
parent | d22766f458a8539a40a57f3946459a9be1f21cd6 (diff) | |
download | volse-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/CalDAV/Xml/Filter/PropFilter.php')
-rw-r--r-- | vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php index db9207295..f4600574e 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Filter; use Sabre\CalDAV\Plugin; @@ -22,8 +24,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class PropFilter implements XmlDeserializable { - +class PropFilter implements XmlDeserializable +{ /** * The deserialize method is called during xml parsing. * @@ -43,16 +45,17 @@ class PropFilter implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = [ - 'name' => null, + 'name' => null, 'is-not-defined' => false, - 'param-filters' => [], - 'text-match' => null, - 'time-range' => false, + 'param-filters' => [], + 'text-match' => null, + 'time-range' => false, ]; $att = $reader->parseAttributes(); @@ -60,39 +63,35 @@ class PropFilter implements XmlDeserializable { $elems = $reader->parseInnerTree(); - if (is_array($elems)) foreach ($elems as $elem) { - - switch ($elem['name']) { - - case '{' . Plugin::NS_CALDAV . '}param-filter' : + if (is_array($elems)) { + foreach ($elems as $elem) { + switch ($elem['name']) { + case '{'.Plugin::NS_CALDAV.'}param-filter': $result['param-filters'][] = $elem['value']; break; - case '{' . Plugin::NS_CALDAV . '}is-not-defined' : + case '{'.Plugin::NS_CALDAV.'}is-not-defined': $result['is-not-defined'] = true; break; - case '{' . Plugin::NS_CALDAV . '}time-range' : + case '{'.Plugin::NS_CALDAV.'}time-range': $result['time-range'] = [ 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, ]; if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { throw new BadRequest('The end-date must be larger than the start-date'); } break; - case '{' . Plugin::NS_CALDAV . '}text-match' : + case '{'.Plugin::NS_CALDAV.'}text-match': $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && $elem['attributes']['negate-condition'] === 'yes', - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', - 'value' => $elem['value'], + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', + 'value' => $elem['value'], ]; break; - } - + } } return $result; - } - } |