aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Property/Time.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/Time.php')
-rw-r--r--vendor/sabre/vobject/lib/Property/Time.php35
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);
-
}
-
}