]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/ApiResponse.php
Merge remote-tracking branch 'upstream/develop' into inbox-gsid
[friendica.git] / src / Module / Api / ApiResponse.php
index 0eb2f644b9fc57b5a893dad58c94914890dd524a..a113dab84f3b110f400b5cf4d8e2d5def81fa4c6 100644 (file)
@@ -1,6 +1,6 @@
 <?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
  *
@@ -107,9 +107,10 @@ class ApiResponse extends Response
         *
         * @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;
@@ -149,6 +150,7 @@ class ApiResponse extends Response
                        case 'atom':
                        case 'xml':
                                return $this->createXML($data, $root_element);
+
                        case 'json':
                        default:
                                return $data;
@@ -219,6 +221,7 @@ class ApiResponse extends Response
                        case 'xml':
                                $this->setType(static::TYPE_XML);
                                break;
+
                        case 'json':
                                $this->setType(static::TYPE_JSON);
                                if (!empty($return)) {
@@ -229,9 +232,11 @@ class ApiResponse extends Response
                                        $return = $json;
                                }
                                break;
+
                        case 'rss':
                                $this->setType(static::TYPE_RSS);
                                break;
+
                        case 'atom':
                                $this->setType(static::TYPE_ATOM);
                                break;
@@ -244,6 +249,8 @@ class ApiResponse extends Response
         * Wrapper around exit() for JSON only responses
         *
         * @param array $data
+        *
+        * @return void
         */
        public function exitWithJson(array $data)
        {