aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Writer.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-04-25 11:24:09 +0200
committerMario <mario@mariovavti.com>2019-04-25 11:24:09 +0200
commitf1c07977809ce3221286d53e99f0d91145b1166f (patch)
tree4c067a3b701ea56f10070c386b26a30f93666eb0 /vendor/sabre/vobject/lib/Writer.php
parent701167bc125700efb3e6ce759b85bcb4d36ee42e (diff)
downloadvolse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.gz
volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.tar.bz2
volse-hubzilla-f1c07977809ce3221286d53e99f0d91145b1166f.zip
Revert "update composer libs"
This reverts commit e779335d060b3a51d6a144d23af4097ae6801473
Diffstat (limited to 'vendor/sabre/vobject/lib/Writer.php')
-rw-r--r--vendor/sabre/vobject/lib/Writer.php30
1 files changed, 19 insertions, 11 deletions
diff --git a/vendor/sabre/vobject/lib/Writer.php b/vendor/sabre/vobject/lib/Writer.php
index c70a6ae4d..f8a58758d 100644
--- a/vendor/sabre/vobject/lib/Writer.php
+++ b/vendor/sabre/vobject/lib/Writer.php
@@ -14,8 +14,8 @@ use Sabre\Xml;
* @author Ivan Enderlin
* @license http://sabre.io/license/ Modified BSD License
*/
-class Writer
-{
+class Writer {
+
/**
* Serializes a vCard or iCalendar object.
*
@@ -23,22 +23,24 @@ class Writer
*
* @return string
*/
- public static function write(Component $component)
- {
+ static function write(Component $component) {
+
return $component->serialize();
+
}
/**
* Serializes a jCal or jCard object.
*
* @param Component $component
- * @param int $options
+ * @param int $options
*
* @return string
*/
- public static function writeJson(Component $component, $options = 0)
- {
+ static function writeJson(Component $component, $options = 0) {
+
return json_encode($component, $options);
+
}
/**
@@ -48,8 +50,8 @@ class Writer
*
* @return string
*/
- public static function writeXml(Component $component)
- {
+ static function writeXml(Component $component) {
+
$writer = new Xml\Writer();
$writer->openMemory();
$writer->setIndent(true);
@@ -57,11 +59,15 @@ class Writer
$writer->startDocument('1.0', 'utf-8');
if ($component instanceof Component\VCalendar) {
+
$writer->startElement('icalendar');
- $writer->writeAttribute('xmlns', Parser\XML::XCAL_NAMESPACE);
+ $writer->writeAttribute('xmlns', Parser\Xml::XCAL_NAMESPACE);
+
} else {
+
$writer->startElement('vcards');
- $writer->writeAttribute('xmlns', Parser\XML::XCARD_NAMESPACE);
+ $writer->writeAttribute('xmlns', Parser\Xml::XCARD_NAMESPACE);
+
}
$component->xmlSerialize($writer);
@@ -69,5 +75,7 @@ class Writer
$writer->endElement();
return $writer->outputMemory();
+
}
+
}