From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 28 May 2016 17:46:24 +0200 Subject: upgrade to sabre32 --- vendor/sabre/vobject/lib/Property/Float.php | 104 ++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 vendor/sabre/vobject/lib/Property/Float.php (limited to 'vendor/sabre/vobject/lib/Property/Float.php') diff --git a/vendor/sabre/vobject/lib/Property/Float.php b/vendor/sabre/vobject/lib/Property/Float.php new file mode 100644 index 000000000..25bcd3db2 --- /dev/null +++ b/vendor/sabre/vobject/lib/Property/Float.php @@ -0,0 +1,104 @@ +delimiter, $val); + foreach($val as &$item) { + $item = (float)$item; + } + $this->setParts($val); + + } + + /** + * Returns a raw mime-dir representation of the value. + * + * @return string + */ + public function getRawMimeDirValue() { + + return implode( + $this->delimiter, + $this->getParts() + ); + + } + + /** + * Returns the type of value. + * + * This corresponds to the VALUE= parameter. Every property also has a + * 'default' valueType. + * + * @return string + */ + public function getValueType() { + + return "FLOAT"; + + } + + /** + * Returns the value, in the format it should be encoded for json. + * + * This method must always return an array. + * + * @return array + */ + public function getJsonValue() { + + $val = array_map( + function($item) { + + return (float)$item; + + }, + $this->getParts() + ); + + // Special-casing the GEO property. + // + // See: + // http://tools.ietf.org/html/draft-ietf-jcardcal-jcal-04#section-3.4.1.2 + if ($this->name==='GEO') { + return array($val); + } else { + return $val; + } + + } +} -- cgit v1.2.3