<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*
* @param array $arr Array to be passed to template
* @param int $cid Contact ID of template
+ *
* @return array
*/
- private function addRSSValues(array $arr, int $cid)
+ private function addRSSValues(array $arr, int $cid): array
{
if (empty($cid)) {
return $arr;
case 'atom':
case 'xml':
return $this->createXML($data, $root_element);
+
case 'json':
default:
return $data;
case 'xml':
$this->setType(static::TYPE_XML);
break;
+
case 'json':
$this->setType(static::TYPE_JSON);
if (!empty($return)) {
$return = $json;
}
break;
+
case 'rss':
$this->setType(static::TYPE_RSS);
break;
+
case 'atom':
$this->setType(static::TYPE_ATOM);
break;
* Wrapper around exit() for JSON only responses
*
* @param array $data
+ *
+ * @return void
*/
public function exitWithJson(array $data)
{