diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-04-25 11:47:18 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2019-04-25 11:47:18 +0200 |
commit | a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84 (patch) | |
tree | 65d1d73918ccb1d4ccc36184d70af2e8dd91f28e /vendor/sabre/vobject/lib/Property/Time.php | |
parent | f1c07977809ce3221286d53e99f0d91145b1166f (diff) | |
download | volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.tar.gz volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.tar.bz2 volse-hubzilla-a60c2f38c689f254bd8bb8e7ea9af78bf21c1f84.zip |
update sabre/vobject
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); - } - } |