diff options
author | Max Kostikov <max@kostikov.co> | 2019-05-02 11:33:07 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-05-02 11:33:07 +0200 |
commit | 47fba5827bd106f53625b543f30643ca5ba1c16e (patch) | |
tree | bef05781eacc6dbc67d03899e0dde0257ce58096 /vendor/sabre/vobject/lib/Property/Time.php | |
parent | 47f75ad8bfbe8325a76ae6fe466aa8080fc87045 (diff) | |
parent | 516167c0f8579c8a068b6e52557e7e1109f897ae (diff) | |
download | volse-hubzilla-47fba5827bd106f53625b543f30643ca5ba1c16e.tar.gz volse-hubzilla-47fba5827bd106f53625b543f30643ca5ba1c16e.tar.bz2 volse-hubzilla-47fba5827bd106f53625b543f30643ca5ba1c16e.zip |
Merge branch 'dev' into 'dev'
# Conflicts:
# Zotlabs/Lib/ThreadItem.php
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/Time.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/Time.php | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/vendor/sabre/vobject/lib/Property/Time.php b/vendor/sabre/vobject/lib/Property/Time.php index dbafc3b85..7aeafc8d0 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,10 +31,9 @@ class Time extends Text { * * @return string */ - function getValueType() { - + public function getValueType() + { return 'TIME'; - } /** @@ -43,11 +42,9 @@ class Time extends Text { * The value must always be an array. * * @param array $value - * - * @return void */ - function setJsonValue(array $value) { - + public function setJsonValue(array $value) + { // Removing colons from value. $value = str_replace( ':', @@ -55,12 +52,11 @@ class Time extends Text { $value ); - if (count($value) === 1) { + if (1 === count($value)) { $this->setValue(reset($value)); } else { $this->setValue($value); } - } /** @@ -70,8 +66,8 @@ class Time extends Text { * * @return array */ - function getJsonValue() { - + public function getJsonValue() + { $parts = DateTimeParser::parseVCardTime($this->getValue()); $timeStr = ''; @@ -109,7 +105,7 @@ class Time extends Text { // Timezone if (!is_null($parts['timezone'])) { - if ($parts['timezone'] === 'Z') { + if ('Z' === $parts['timezone']) { $timeStr .= 'Z'; } else { $timeStr .= @@ -118,7 +114,6 @@ class Time extends Text { } return [$timeStr]; - } /** @@ -126,19 +121,15 @@ class Time extends Text { * object. * * @param array $value - * - * @return void */ - function setXmlValue(array $value) { - + public function setXmlValue(array $value) + { $value = array_map( - function($value) { + function ($value) { return str_replace(':', '', $value); }, $value ); parent::setXmlValue($value); - } - } |