Use implode for entry values

This commit is contained in:
Oliver Davies 2018-01-05 00:31:59 +00:00
parent f32d4a5139
commit 37835fa7c8

View file

@ -68,7 +68,7 @@ class Builder
return vsprintf("<apps:property name='%s' value='%s'/>", [
$key,
htmlentities($value),
htmlentities($this->implode($value)),
]);
}
@ -77,6 +77,14 @@ class Builder
*/
private function implode($value, $separator = '|')
{
if (is_string($value)) {
return $value;
}
if (is_array($value) && count($value) === 1) {
return reset($value);
}
return sprintf('(%s)', collect($value)->implode($separator));
}
}