Skip to content

Commit 598f2b3

Browse files
committed
docs: replace $response with $this->response
1 parent a1a763b commit 598f2b3

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

3-
$response->setHeader('Location', 'http://example.com')
3+
$this->response->setHeader('Location', 'http://example.com')
44
->setHeader('WWW-Authenticate', 'Negotiate');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

3-
$response->setHeader('Cache-Control', 'no-cache')
3+
$this->response->setHeader('Cache-Control', 'no-cache')
44
->appendHeader('Cache-Control', 'must-revalidate');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
$response->removeHeader('Location');
3+
$this->response->removeHeader('Location');

user_guide_src/source/outgoing/response/007.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
$data = 'Here is some text!';
44
$name = 'mytext.txt';
55

6-
return $response->download($name, $data);
6+
return $this->response->download($name, $data);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

33
// Contents of photo.jpg will be automatically read
4-
return $response->download('/path/to/photo.jpg', null);
4+
return $this->response->download('/path/to/photo.jpg', null);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return $response->download('awkwardEncryptedFileName.fakeExt', null)->setFileName('expenses.csv');
3+
return $this->response->download('awkwardEncryptedFileName.fakeExt', null)->setFileName('expenses.csv');
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
<?php
22

33
// specify the default directive treatment
4-
$response->CSP->reportOnly(false);
4+
$this->response->CSP->reportOnly(false);
55

66
// specify the origin to use if none provided for a directive
7-
$response->CSP->setDefaultSrc('cdn.example.com');
7+
$this->response->CSP->setDefaultSrc('cdn.example.com');
88

99
// specify the URL that "report-only" reports get sent to
10-
$response->CSP->setReportURI('http://example.com/csp/reports');
10+
$this->response->CSP->setReportURI('http://example.com/csp/reports');
1111

1212
// specify that HTTP requests be upgraded to HTTPS
13-
$response->CSP->upgradeInsecureRequests(true);
13+
$this->response->CSP->upgradeInsecureRequests(true);
1414

1515
// add types or origins to CSP directives
1616
// assuming that the default treatment is to block rather than just report
17-
$response->CSP->addBaseURI('example.com', true); // report only
18-
$response->CSP->addChildSrc('https://youtube.com'); // blocked
19-
$response->CSP->addConnectSrc('https://*.facebook.com', false); // blocked
20-
$response->CSP->addFontSrc('fonts.example.com');
21-
$response->CSP->addFormAction('self');
22-
$response->CSP->addFrameAncestor('none', true); // report this one
23-
$response->CSP->addImageSrc('cdn.example.com');
24-
$response->CSP->addMediaSrc('cdn.example.com');
25-
$response->CSP->addManifestSrc('cdn.example.com');
26-
$response->CSP->addObjectSrc('cdn.example.com', false); // reject from here
27-
$response->CSP->addPluginType('application/pdf', false); // reject this media type
28-
$response->CSP->addScriptSrc('scripts.example.com', true); // allow but report requests from here
29-
$response->CSP->addStyleSrc('css.example.com');
30-
$response->CSP->addSandbox(['allow-forms', 'allow-scripts']);
17+
$this->response->CSP->addBaseURI('example.com', true); // report only
18+
$this->response->CSP->addChildSrc('https://youtube.com'); // blocked
19+
$this->response->CSP->addConnectSrc('https://*.facebook.com', false); // blocked
20+
$this->response->CSP->addFontSrc('fonts.example.com');
21+
$this->response->CSP->addFormAction('self');
22+
$this->response->CSP->addFrameAncestor('none', true); // report this one
23+
$this->response->CSP->addImageSrc('cdn.example.com');
24+
$this->response->CSP->addMediaSrc('cdn.example.com');
25+
$this->response->CSP->addManifestSrc('cdn.example.com');
26+
$this->response->CSP->addObjectSrc('cdn.example.com', false); // reject from here
27+
$this->response->CSP->addPluginType('application/pdf', false); // reject this media type
28+
$this->response->CSP->addScriptSrc('scripts.example.com', true); // allow but report requests from here
29+
$this->response->CSP->addStyleSrc('css.example.com');
30+
$this->response->CSP->addSandbox(['allow-forms', 'allow-scripts']);

0 commit comments

Comments
 (0)