Skip to content

Commit daaa135

Browse files
authored
Merge pull request #6700 from kenjis/refactor-getHeaders
refactor: replace deprecated getHeaders() with headers()
2 parents 44fe2f5 + 8893175 commit daaa135

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

app/Views/errors/html/error_exception.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270

271271
<?php endif; ?>
272272

273-
<?php $headers = $request->getHeaders(); ?>
273+
<?php $headers = $request->headers(); ?>
274274
<?php if (! empty($headers)) : ?>
275275

276276
<h3>Headers</h3>
@@ -318,7 +318,7 @@
318318
</tr>
319319
</table>
320320

321-
<?php $headers = $response->getHeaders(); ?>
321+
<?php $headers = $response->headers(); ?>
322322
<?php if (! empty($headers)) : ?>
323323
<?php natsort($headers) ?>
324324

system/HTTP/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public function sendHeaders()
471471
header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getReasonPhrase()), true, $this->getStatusCode());
472472

473473
// Send all of our headers
474-
foreach (array_keys($this->getHeaders()) as $name) {
474+
foreach (array_keys($this->headers()) as $name) {
475475
header($name . ': ' . $this->getHeaderLine($name), false, $this->getStatusCode());
476476
}
477477

user_guide_src/source/libraries/curlrequest/006.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
echo $response->getStatusCode();
44
echo $response->getBody();
5-
echo $response->getHeader('Content-Type');
5+
echo $response->header('Content-Type');
66
$language = $response->negotiateLanguage(['en', 'fr']);

user_guide_src/source/libraries/curlrequest/010.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
echo $response->getHeaderLine('Content-Type');
55

66
// Get all headers
7-
foreach ($response->getHeaders() as $name => $value) {
7+
foreach ($response->headers() as $name => $value) {
88
echo $name . ': ' . $response->getHeaderLine($name) . "\n";
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
if (strpos($response->getHeader('content-type'), 'application/json') !== false) {
3+
if (strpos($response->header('content-type'), 'application/json') !== false) {
44
$body = json_decode($body);
55
}

0 commit comments

Comments
 (0)