*
* @return string The XML data
*/
-function api_create_xml($data, $root_element)
+function api_create_xml(array $data, $root_element)
{
$childname = key($data);
$data2 = array_pop($data);
$i = 1;
foreach ($data2 as $item) {
- $data4[$i++.":".$childname] = $item;
+ $data4[$i++ . ":" . $childname] = $item;
}
$data2 = $data4;
}
function render_location_dummy(array $item) {
- if ($item['location'] != "") {
+ if (x($item, 'location') && !empty($item['location'])) {
return $item['location'];
}
- if ($item['coord'] != "") {
+ if (x($item, 'coord') && !empty($item['coord'])) {
return $item['coord'];
}
}
-function get_responses(array $conv_responses, array $response_verbs, $ob, $item) {
+function get_responses(array $conv_responses, array $response_verbs, $ob, array $item) {
$ret = [];
foreach ($response_verbs as $v) {
$ret[$v] = [];