]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/ApiResponse.php
Fix test
[friendica.git] / src / Module / Api / ApiResponse.php
index c4b9b1e943162f4bbbd8475c65ebf0c9ff5727cc..a6a94ad81c559e209635013e2da2039b35eb1e73 100644 (file)
@@ -221,6 +221,16 @@ class ApiResponse extends Response
                $this->addContent($return);
        }
 
+       /**
+        * Wrapper around exit() for JSON only responses
+        *
+        * @param array $data
+        */
+       public function exitWithJson(array $data)
+       {
+               $this->exit('content', ['content' => $data], static::TYPE_JSON);
+       }
+
        /**
         * Quit execution with the message that the endpoint isn't implemented
         *