diff --git a/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php b/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php index e6fac79..c18cf56 100644 --- a/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php +++ b/core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php @@ -29,6 +29,9 @@ class NoSessionOpen implements RequestPolicyInterface { /** * Constructs a new page cache session policy. + * + * @param string $session_cookie_name + * (optional) The name of the session cookie. Defaults to session_name(). */ public function __construct($session_cookie_name = NULL) { $this->sessionCookieName = $session_cookie_name ?: session_name(); diff --git a/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php b/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php index 17c2771..b287e60 100644 --- a/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php +++ b/core/lib/Drupal/Core/PageCache/RequestPolicyInterface.php @@ -31,6 +31,9 @@ /** * Determines whether delivery of a cached page should be attempted. * + * @param \Symfony\Component\HttpFoundation\Request $request + * The incoming request object. + * * @return string|NULL * One of static::ALLOW, static::DENY or NULL. Calling code may attempt to * deliver a cached page if static::ALLOW is returned. Returns NULL if the diff --git a/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php b/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php index 7e76977..596f43f 100644 --- a/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php +++ b/core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php @@ -27,6 +27,11 @@ /** * Determines whether it is save to store a page in the cache. * + * @param \Symfony\Component\HttpFoundation\Response $response + * The response which is about to be sent to the client. + * @param \Symfony\Component\HttpFoundation\Request $request + * The request object. + * * @return string|NULL * Either static::DENY or NULL. Calling code may attempt to store a page in * the cache unless static::DENY is returned. Returns NULL if the policy diff --git a/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php b/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php index 8beba08..02cb27c 100644 --- a/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php +++ b/core/modules/image/src/PageCache/DenyPrivateImageStyleDownload.php @@ -38,7 +38,7 @@ public function __construct(RouteMatchInterface $route_match) { } /** - * Test whether this request goes to /image/preview. + * {@inheritdoc} */ public function check(Response $response, Request $request) { if ($this->routeMatch->getRouteName() === 'image.style_private') { diff --git a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php index bdb6f72..fab54d3 100644 --- a/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php +++ b/core/modules/image/tests/src/Unit/PageCache/DenyPrivateImageStyleDownloadTest.php @@ -22,7 +22,7 @@ class DenyPrivateImageStyleDownloadTest extends UnitTestCase { /** * The response policy under test. * - * @var \Drupal\Core\PageCache\DenyPrivateImageStyleDownload + * @var \Drupal\image\PageCache\DenyPrivateImageStyleDownload */ protected $policy; @@ -55,7 +55,7 @@ public function setUp() { } /** - * Asserts that chaching is denied on the private image style download route. + * Asserts that caching is denied on the private image style download route. * * @dataProvider providerPrivateImageStyleDownloadPolicy * @covers ::check diff --git a/core/modules/node/src/PageCache/DenyNodePreview.php b/core/modules/node/src/PageCache/DenyNodePreview.php index 0f78018..5e749a0 100644 --- a/core/modules/node/src/PageCache/DenyNodePreview.php +++ b/core/modules/node/src/PageCache/DenyNodePreview.php @@ -38,7 +38,7 @@ public function __construct(RouteMatchInterface $route_match) { } /** - * Test whether this request goes to /node/preview. + * {@inheritdoc} */ public function check(Response $response, Request $request) { if ($this->routeMatch->getRouteName() === 'entity.node.preview') { diff --git a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php index c5df27e..ea90c53 100644 --- a/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php +++ b/core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php @@ -22,7 +22,7 @@ class DenyNodePreviewTest extends UnitTestCase { /** * The response policy under test. * - * @var \Drupal\Core\PageCache\DenyNodePreview + * @var \Drupal\node\PageCache\DenyNodePreview */ protected $policy; @@ -55,7 +55,7 @@ public function setUp() { } /** - * Asserts that chaching is denied on the node preview route. + * Asserts that caching is denied on the node preview route. * * @dataProvider providerPrivateImageStyleDownloadPolicy * @covers ::check diff --git a/core/modules/toolbar/src/PageCache/AllowToolbarPath.php b/core/modules/toolbar/src/PageCache/AllowToolbarPath.php index bb331af..47a4989 100644 --- a/core/modules/toolbar/src/PageCache/AllowToolbarPath.php +++ b/core/modules/toolbar/src/PageCache/AllowToolbarPath.php @@ -19,7 +19,7 @@ class AllowToolbarPath implements RequestPolicyInterface { /** - * Test whether this request goes to /toolbar/subtrees. + * {@inheritdoc} */ public function check(Request $request) { $path = $request->getPathInfo(); diff --git a/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php b/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php index cbd7c45..a783c71 100644 --- a/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php +++ b/core/modules/toolbar/tests/src/Unit/PageCache/AllowToolbarPathTest.php @@ -21,7 +21,7 @@ class AllowToolbarPathTest extends UnitTestCase { /** * The toolbar path policy under test. * - * @var \Drupal\Core\PageCache\RequestPolicy\AllowToolbarPath + * @var \Drupal\toolbar\PageCache\AllowToolbarPath */ protected $policy; diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php index e3e779c..3343735 100644 --- a/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php +++ b/core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php @@ -136,7 +136,7 @@ public function providerAllowIfAnyRuleReturnedAllow() { } /** - * Asserts that check() returns imediately when a rule returned DENY. + * Asserts that check() returns immediately when a rule returned DENY. */ public function testStopChainOnFirstDeny() { $rule1 = $this->getMock('Drupal\Core\PageCache\RequestPolicyInterface'); diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php index 2dbfba3..d991678 100644 --- a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php +++ b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php @@ -112,7 +112,7 @@ public function providerChainExceptionOnInvalidReturnValue() { } /** - * Asserts that check() returns imediately when a rule returned DENY. + * Asserts that check() returns immediately when a rule returned DENY. */ public function testStopChainOnFirstDeny() { $rule1 = $this->getMock('Drupal\Core\PageCache\ResponsePolicyInterface');