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