function ChainResponsePolicy::check
Same name in this branch
- 8.9.x core/lib/Drupal/Core/ProxyClass/PageCache/ChainResponsePolicy.php \Drupal\Core\ProxyClass\PageCache\ChainResponsePolicy::check()
Same name in other branches
- 9 core/lib/Drupal/Core/ProxyClass/PageCache/ChainResponsePolicy.php \Drupal\Core\ProxyClass\PageCache\ChainResponsePolicy::check()
- 9 core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php \Drupal\Core\PageCache\ChainResponsePolicy::check()
- 10 core/lib/Drupal/Core/ProxyClass/PageCache/ChainResponsePolicy.php \Drupal\Core\ProxyClass\PageCache\ChainResponsePolicy::check()
- 10 core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php \Drupal\Core\PageCache\ChainResponsePolicy::check()
- 11.x core/lib/Drupal/Core/ProxyClass/PageCache/ChainResponsePolicy.php \Drupal\Core\ProxyClass\PageCache\ChainResponsePolicy::check()
- 11.x core/lib/Drupal/Core/PageCache/ChainResponsePolicy.php \Drupal\Core\PageCache\ChainResponsePolicy::check()
Overrides ResponsePolicyInterface::check
File
-
core/
lib/ Drupal/ Core/ PageCache/ ChainResponsePolicy.php, line 32
Class
- ChainResponsePolicy
- Implements a compound response policy.
Namespace
Drupal\Core\PageCacheCode
public function check(Response $response, Request $request) {
foreach ($this->rules as $rule) {
$result = $rule->check($response, $request);
if ($result === static::DENY) {
return $result;
}
elseif (isset($result)) {
throw new \UnexpectedValueException('Return value of ResponsePolicyInterface::check() must be one of ResponsePolicyInterface::DENY or NULL');
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.