Skip to content

Commit

Permalink
Merge pull request #65 from amirkhodabande/refactor_conditions
Browse files Browse the repository at this point in the history
Refactor conditionals in `AbstractControllerTestCase`
  • Loading branch information
Ocramius authored Nov 13, 2022
2 parents 3472930 + d56dc0d commit 90de08e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/PHPUnit/Controller/AbstractControllerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function tearDown(): void
*/
protected function createFailureMessage($message)
{
if (true !== $this->traceError) {
if (! $this->traceError) {
return $message;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 90de08e

Please sign in to comment.