diff options
author | Mario <mario@mariovavti.com> | 2019-04-25 11:24:09 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-04-25 11:24:09 +0200 |
commit | f1c07977809ce3221286d53e99f0d91145b1166f (patch) | |
tree | 4c067a3b701ea56f10070c386b26a30f93666eb0 /vendor/sabre/vobject/lib/Property/Time.php | |
parent | 701167bc125700efb3e6ce759b85bcb4d36ee42e (diff) | |
download | volse-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/Property/Time.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/Time.php | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/vendor/sabre/vobject/lib/Property/Time.php b/vendor/sabre/vobject/lib/Property/Time.php index 7aeafc8d0..dbafc3b85 100644 --- a/vendor/sabre/vobject/lib/Property/Time.php +++ b/vendor/sabre/vobject/lib/Property/Time.php @@ -13,8 +13,8 @@ use Sabre\VObject\DateTimeParser; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Time extends Text -{ +class Time extends Text { + /** * In case this is a multi-value property. This string will be used as a * delimiter. @@ -31,9 +31,10 @@ class Time extends Text * * @return string */ - public function getValueType() - { + function getValueType() { + return 'TIME'; + } /** @@ -42,9 +43,11 @@ class Time extends Text * The value must always be an array. * * @param array $value + * + * @return void */ - public function setJsonValue(array $value) - { + function setJsonValue(array $value) { + // Removing colons from value. $value = str_replace( ':', @@ -52,11 +55,12 @@ class Time extends Text $value ); - if (1 === count($value)) { + if (count($value) === 1) { $this->setValue(reset($value)); } else { $this->setValue($value); } + } /** @@ -66,8 +70,8 @@ class Time extends Text * * @return array */ - public function getJsonValue() - { + function getJsonValue() { + $parts = DateTimeParser::parseVCardTime($this->getValue()); $timeStr = ''; @@ -105,7 +109,7 @@ class Time extends Text // Timezone if (!is_null($parts['timezone'])) { - if ('Z' === $parts['timezone']) { + if ($parts['timezone'] === 'Z') { $timeStr .= 'Z'; } else { $timeStr .= @@ -114,6 +118,7 @@ class Time extends Text } return [$timeStr]; + } /** @@ -121,15 +126,19 @@ class Time extends Text * object. * * @param array $value + * + * @return void */ - public function setXmlValue(array $value) - { + function setXmlValue(array $value) { + $value = array_map( - function ($value) { + function($value) { return str_replace(':', '', $value); }, $value ); parent::setXmlValue($value); + } + } |