Skip to content

Commit 90de08e

Browse files
authored
Merge pull request #65 from amirkhodabande/refactor_conditions
Refactor conditionals in `AbstractControllerTestCase`
2 parents 3472930 + d56dc0d commit 90de08e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/PHPUnit/Controller/AbstractControllerTestCase.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function tearDown(): void
9191
*/
9292
protected function createFailureMessage($message)
9393
{
94-
if (true !== $this->traceError) {
94+
if (! $this->traceError) {
9595
return $message;
9696
}
9797

@@ -291,12 +291,11 @@ public function url($url, $method = HttpRequest::METHOD_GET, $params = [])
291291
public function dispatch($url, $method = null, $params = [], $isXmlHttpRequest = false)
292292
{
293293
if (
294-
! isset($method)
294+
! $method
295295
&& $this->getRequest() instanceof HttpRequest
296-
&& $requestMethod = $this->getRequest()->getMethod()
297296
) {
298-
$method = $requestMethod;
299-
} elseif (! isset($method)) {
297+
$method = $this->getRequest()->getMethod();
298+
} elseif (! $method) {
300299
$method = HttpRequest::METHOD_GET;
301300
}
302301

0 commit comments

Comments
 (0)