Преглед изворни кода

fix: RequestValidateFacade Variable could not be converted to string (#925)

Co-authored-by: Thibault GRANADA <thibault.granada@koesio.com>
TZK- пре 5 месеци
родитељ
комит
e8267c9128

+ 4 - 3
src/Extracting/Shared/ValidationRulesFinders/RequestValidateFacade.php

@@ -25,13 +25,14 @@ class RequestValidateFacade
 
         if (
             $expr instanceof Node\Expr\StaticCall
-            && in_array((string) $expr->class, ['Request', \Illuminate\Support\Facades\Request::class])
+            && $expr->class instanceof Node\Name
+            && in_array($expr->class->name, ['Request', \Illuminate\Support\Facades\Request::class])
         ) {
-            if ($expr->name->name == "validate") {
+            if ($expr->name->name === "validate") {
                 return $expr->args[0]->value;
             }
 
-            if ($expr->name->name == "validateWithBag") {
+            if ($expr->name->name === "validateWithBag") {
                 return $expr->args[1]->value;
             }
         }