Skip to content

Commit 048d997

Browse files
authored
Merge pull request #5700 from kenjis/fix-deprecated-getReason
refactor: replace deprecated Response::getReason() with getReasonPhrase()
2 parents 5dfa393 + 2fbd9b6 commit 048d997

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/Views/errors/html/error_exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
<table>
315315
<tr>
316316
<td style="width: 15em">Response Status</td>
317-
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReason()) ?></td>
317+
<td><?= esc($response->getStatusCode() . ' - ' . $response->getReasonPhrase()) ?></td>
318318
</tr>
319319
</table>
320320

system/HTTP/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function sendHeaders()
467467
}
468468

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

472472
// Send all of our headers
473473
foreach (array_keys($this->getHeaders()) as $name) {

tests/system/HTTP/DownloadResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function testThrowExceptionWhenNoSetDownloadSource()
277277
public function testGetReason()
278278
{
279279
$response = new DownloadResponse('unit-test.php', false);
280-
$this->assertSame('OK', $response->getReason());
280+
$this->assertSame('OK', $response->getReasonPhrase());
281281
}
282282

283283
public function testPretendOutput()

0 commit comments

Comments
 (0)