Bladeren bron

default empty parameters array

tags/0.1.0
Robin Thoni 9 jaren geleden
bovenliggende
commit
72cbf85192
2 gewijzigde bestanden met toevoegingen van 5 en 7 verwijderingen
  1. 3
    5
      src/Utils/LuController.php
  2. 2
    2
      src/Utils/LuDbo.php

+ 3
- 5
src/Utils/LuController.php Bestand weergeven

@@ -6,13 +6,11 @@ use Laravel\Lumen\Routing\Controller as BaseController;
6 6
 
7 7
 class LuController extends BaseController
8 8
 {
9
-    public static $parameters = null;
9
+    public static $parameters = array();
10 10
 
11 11
     function execute($businessClass, $businessMethod)
12 12
     {
13
-        $params = app('request')->route()[2];
14
-        self::$parameters = array_merge($_GET, $_POST, $params);
15
-        $business = new $businessClass();
13
+        self::$parameters = array_merge($_GET, $_POST, app('request')->route()[2], self::$parameters);
16 14
 
17 15
         $reflect = new \ReflectionMethod($businessClass, $businessMethod);
18 16
         $params = $reflect->getParameters();
@@ -27,6 +25,6 @@ class LuController extends BaseController
27 25
             }
28 26
         }
29 27
 
30
-        return LuOutputFormatter::formatSuccess(call_user_func_array(array($business, $businessMethod), $args));
28
+        return LuOutputFormatter::formatSuccess(forward_static_call_array(array($businessClass, $businessMethod), $args));
31 29
     }
32 30
 }

+ 2
- 2
src/Utils/LuDbo.php Bestand weergeven

@@ -12,8 +12,8 @@ abstract class LuDbo implements \JsonSerializable {
12 12
     }
13 13
 
14 14
     /**
15
-     * @param $newClass $newClass
16
-     * @return mixed
15
+     * @param $newClass LuDbo
16
+     * @return LuDbo
17 17
      */
18 18
     public function castAs($newClass) {
19 19
         $obj = new $newClass;

Laden…
Annuleren
Opslaan