From d56dc0d8d26de057baddf3c72cd21509f4a2096e Mon Sep 17 00:00:00 2001 From: Amir Date: Sun, 13 Nov 2022 20:41:35 +0330 Subject: [PATCH] avoid declaring useless variable in condition Signed-off-by: Amir --- src/PHPUnit/Controller/AbstractControllerTestCase.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PHPUnit/Controller/AbstractControllerTestCase.php b/src/PHPUnit/Controller/AbstractControllerTestCase.php index d3ce7968..59654357 100644 --- a/src/PHPUnit/Controller/AbstractControllerTestCase.php +++ b/src/PHPUnit/Controller/AbstractControllerTestCase.php @@ -291,12 +291,11 @@ public function url($url, $method = HttpRequest::METHOD_GET, $params = []) public function dispatch($url, $method = null, $params = [], $isXmlHttpRequest = false) { if ( - ! isset($method) + ! $method && $this->getRequest() instanceof HttpRequest - && $requestMethod = $this->getRequest()->getMethod() ) { - $method = $requestMethod; - } elseif (! isset($method)) { + $method = $this->getRequest()->getMethod(); + } elseif (! $method) { $method = HttpRequest::METHOD_GET; }