diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
commit | 429140df97a2c273fba6974147ac2e48e7688263 (patch) | |
tree | 2e337542da1b0f4c9c383dfeb8a7d9eb63990a72 /vendor/sabre/vobject/lib/Property/Binary.php | |
parent | f92d2e3f7c6573bd7bab04223c7e28662605c6d8 (diff) | |
parent | af2b263bc74b16601ec7c123a58f0549613aed27 (diff) | |
download | volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.gz volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.bz2 volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/Binary.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/Binary.php | 47 |
1 files changed, 15 insertions, 32 deletions
diff --git a/vendor/sabre/vobject/lib/Property/Binary.php b/vendor/sabre/vobject/lib/Property/Binary.php index d54cae25d..830dd9028 100644 --- a/vendor/sabre/vobject/lib/Property/Binary.php +++ b/vendor/sabre/vobject/lib/Property/Binary.php @@ -18,8 +18,8 @@ use Sabre\VObject\Property; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Binary extends Property { - +class Binary extends Property +{ /** * In case this is a multi-value property. This string will be used as a * delimiter. @@ -34,25 +34,18 @@ class Binary extends Property { * This may be either a single, or multiple strings in an array. * * @param string|array $value - * - * @return void */ - function setValue($value) { - + public function setValue($value) + { if (is_array($value)) { - - if (count($value) === 1) { + if (1 === count($value)) { $this->value = $value[0]; } else { throw new \InvalidArgumentException('The argument must either be a string or an array with only one child'); } - } else { - $this->value = $value; - } - } /** @@ -62,13 +55,10 @@ class Binary extends Property { * not yet done, but parameters are not included. * * @param string $val - * - * @return void */ - function setRawMimeDirValue($val) { - + public function setRawMimeDirValue($val) + { $this->value = base64_decode($val); - } /** @@ -76,10 +66,9 @@ class Binary extends Property { * * @return string */ - function getRawMimeDirValue() { - + public function getRawMimeDirValue() + { return base64_encode($this->value); - } /** @@ -90,10 +79,9 @@ class Binary extends Property { * * @return string */ - function getValueType() { - + public function getValueType() + { return 'BINARY'; - } /** @@ -103,10 +91,9 @@ class Binary extends Property { * * @return array */ - function getJsonValue() { - + public function getJsonValue() + { return [base64_encode($this->getValue())]; - } /** @@ -115,14 +102,10 @@ class Binary extends Property { * The value must always be an array. * * @param array $value - * - * @return void */ - function setJsonValue(array $value) { - + public function setJsonValue(array $value) + { $value = array_map('base64_decode', $value); parent::setJsonValue($value); - } - } |