Repository: tightenco/tlint (php)

Issue:
Allow  $request->validate()

Pull request:
Fix RequestValidation lint triggering on injected request.
Closes #118 

Patch:
diff --git a/src/Linters/RequestValidation.php b/src/Linters/RequestValidation.php
index 9a97a01..464d08a 100644
--- a/src/Linters/RequestValidation.php
+++ b/src/Linters/RequestValidation.php
@@ -26,9 +26,8 @@ class RequestValidation extends BaseLinter
             if (! $isController && $this->extends($node, 'Controller')) {
                 $isController = true;
             }
-
             return $node instanceof Node\Expr\MethodCall
-                && ! $node->var instanceof Node\Expr\FuncCall
+                && $node->var->name === 'this'
                 && $node->name->name === 'validate';
         });
 


Test patch:
diff --git a/tests/Linting/Linters/RequestValidationTest.php b/tests/Linting/Linters/RequestValidationTest.php
index 5da9263..341823b 100644
--- a/tests/Linting/Linters/RequestValidationTest.php
+++ b/tests/Linting/Linters/RequestValidationTest.php
@@ -70,7 +70,7 @@ class ControllerA extends Controller
 {
     public function store(ARequest \$request)
     {
-        \$request()->validate(['name' => 'required']);
+        \$request->validate([]);
     }
 }
 file;