54 'contentType' =>
$reader->getAttribute(
'content-type') ?:
'text/calendar',
55 'version' =>
$reader->getAttribute(
'version') ?:
'2.0',
58 $elems = (array)
$reader->parseInnerTree();
59 foreach ($elems as $elem) {
61 switch ($elem[
'name']) {
70 throw new BadRequest(
'The "start" and "end" attributes are required when expanding calendar-data');
73 throw new BadRequest(
'The end-date must be larger than the start-date when expanding calendar-data');
An exception for terminatinating execution or to throw for unit testing.
const NS_CALDAV
This is the official CalDAV namespace.
static xmlDeserialize(Reader $reader)
The deserialize method is called during xml parsing.
static parseDateTime($dt, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted datetime and returns a DateTimeImmutable object.
The Reader class expands upon PHP's built-in XMLReader.
Implementing the XmlDeserializable interface allows you to use a class as a deserializer for a specif...