Skip to content

Commit

Permalink
Merge pull request #5700 from kenjis/fix-deprecated-getReason
Browse files Browse the repository at this point in the history
refactor: replace deprecated Response::getReason() with getReasonPhrase()
  • Loading branch information
samsonasik authored Feb 16, 2022
2 parents 5dfa393 + 2fbd9b6 commit 048d997
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Views/errors/html/error_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
<table>
<tr>
<td style="width: 15em">Response Status</td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReason()) ?></td>
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function sendHeaders()
}

// HTTP Status
header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getReason()), true, $this->getStatusCode());
header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getReasonPhrase()), true, $this->getStatusCode());

// Send all of our headers
foreach (array_keys($this->getHeaders()) as $name) {
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/DownloadResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function testThrowExceptionWhenNoSetDownloadSource()
public function testGetReason()
{
$response = new DownloadResponse('unit-test.php', false);
$this->assertSame('OK', $response->getReason());
$this->assertSame('OK', $response->getReasonPhrase());
}

public function testPretendOutput()
Expand Down

0 comments on commit 048d997

Please sign in to comment.