]> jfr.im git - uguu.git/blobdiff - src/Classes/Response.php
bug fixes
[uguu.git] / src / Classes / Response.php
index 7c2fe4f16f9de7230d65c163617a777c477b1c96..678dff66eb532b152ef95800d8fcdedf4e451347 100644 (file)
     
     class Response
     {
-        public mixed $type;
+        public string $type;
         
         /**
          * Takes a string as an argument and sets the header to the appropriate content type
          *
          * @param $response_type string The type of response you want to return. Valid options are: csv, html, json, text.
          */
-        public function __construct(string $response_type = "json")
+        public function __construct(string $response_type)
         {
             switch ($response_type) {
                 case 'csv':
@@ -55,7 +55,6 @@
                 default:
                     header('Content-Type: application/json; charset=UTF-8');
                     $this->type = 'json';
-                    $this->error(400, 'Invalid response type. Valid options are: csv, html, json, text.');
                     break;
             }
         }