ソースを参照

修复 JsonResponse methodIf 用法报错问题

jqh 4 年 前
コミット
ae60c00f8c
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/Http/JsonResponse.php

+ 2 - 1
src/Http/JsonResponse.php

@@ -377,7 +377,7 @@ class JsonResponse
     public function __call($method, $arguments)
     {
         if (Str::endsWith($method, 'If')) {
-            if (array_shift($arguments)) {
+            if ($arguments) {
                 $method = Str::replaceLast('If', '', $method);
 
                 $condition = value(array_shift($arguments));
@@ -393,6 +393,7 @@ class JsonResponse
      * @param mixed ...$params
      *
      * @return $this
+     *
      */
     public static function make(...$params)
     {