Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 1cd2fbd

Browse files
committed
Changes a variable name from $sendOutput to $sendOutputFlag
The value is flag, so this helps indicate that, that it's boolean, and could indicate either state (`$sendOutput` implied a `true` value previously).
1 parent 694eae4 commit 1cd2fbd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Middleware/WhoopsErrorResponseGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function __invoke(
7979

8080
$response = $response->withStatus(Utils::getStatusCode($e, $response));
8181

82-
$sendOutput = $this->whoops->writeToOutput();
82+
$sendOutputFlag = $this->whoops->writeToOutput();
8383
$this->whoops->writeToOutput(false);
8484
$response
8585
->getBody()
8686
->write($this->whoops->handleException($e));
87-
$this->whoops->writeToOutput($sendOutput);
87+
$this->whoops->writeToOutput($sendOutputFlag);
8888

8989
return $response;
9090
}

test/Middleware/WhoopsErrorResponseGeneratorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ public function setUp()
5757
public function testWritesResultsOfWhoopsExceptionsHandlingToResponse()
5858
{
5959
$error = new RuntimeException();
60-
$sendOutput = true;
60+
$sendOutputFlag = true;
6161

6262
$this->whoops->getHandlers()->willReturn([]);
6363
$this->whoops->handleException($error)->willReturn('WHOOPS');
64-
$this->whoops->writeToOutput()->willReturn($sendOutput);
64+
$this->whoops->writeToOutput()->willReturn($sendOutputFlag);
6565
$this->whoops->writeToOutput(false)->shouldBeCalled();
66-
$this->whoops->writeToOutput($sendOutput)->shouldBeCalled();
66+
$this->whoops->writeToOutput($sendOutputFlag)->shouldBeCalled();
6767

6868
// Could do more assertions here, but these will be sufficent for
6969
// ensuring that the method for injecting metadata is never called.
@@ -87,7 +87,7 @@ public function testWritesResultsOfWhoopsExceptionsHandlingToResponse()
8787
public function testAddsRequestMetadataToWhoopsPrettyPageHandler()
8888
{
8989
$error = new RuntimeException('STATUS_INTERNAL_SERVER_ERROR', StatusCode::STATUS_INTERNAL_SERVER_ERROR);
90-
$sendOutput = true;
90+
$sendOutputFlag = true;
9191

9292
$handler = $this->prophesize(PrettyPageHandler::class);
9393
$handler
@@ -105,9 +105,9 @@ public function testAddsRequestMetadataToWhoopsPrettyPageHandler()
105105

106106
$this->whoops->getHandlers()->willReturn([$handler->reveal()]);
107107
$this->whoops->handleException($error)->willReturn('WHOOPS');
108-
$this->whoops->writeToOutput()->willReturn($sendOutput);
108+
$this->whoops->writeToOutput()->willReturn($sendOutputFlag);
109109
$this->whoops->writeToOutput(false)->shouldBeCalled();
110-
$this->whoops->writeToOutput($sendOutput)->shouldBeCalled();
110+
$this->whoops->writeToOutput($sendOutputFlag)->shouldBeCalled();
111111

112112
$this->request->getAttribute('originalUri', false)->willReturn('https://example.com/foo');
113113
$this->request->getAttribute('originalRequest', false)->will([$this->request, 'reveal']);

0 commit comments

Comments
 (0)