Explorar o código

Fixing functions that need to be static

Artur Welp %!s(int64=2) %!d(string=hai) anos
pai
achega
73843d4935
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      src/RR/Response.php

+ 4 - 2
src/RR/Response.php

@@ -36,7 +36,7 @@ class Response{
         return self::$_instance;
     }
 
-    public function getInstance() : Response {
+    public static function getInstance() : Response {
         if (!isset(self::$_instance)) {
             return self::newObj();
         }
@@ -159,9 +159,11 @@ class Response{
      * @ctag Response::redirect($url, $code);
      *
      */
-    public static function redirect($url, $code = 302){
+    public static function redirect($url, $code = 303){
         $instance = self::getInstance();
 
+        $instance->_code = $code;
+
         if(is_ajax_request()){
             return $instance->json(['location' => $url])->send();
         }