public function AuthcacheP13nTestEchoSettingValidator::validate in Authenticated User Page Caching (Authcache) 7.2
Validate the given parameters.
Throw AuthcacheP13nRequestInvalidInput to abort a request.
Note: At the time this method is called, the bootstrap phase is not guaranteed to be greater than DRUPAL_BOOTSTRAP_SESSION. Therefore avoid calling functions which will trigger hook invocations like e.g. entity_load.
Parameters
var $params: Params set by the client.
Return value
array Params to be used in subsequent processing.
Overrides AuthcacheP13nSettingValidatorInterface::validate
File
- modules/
authcache_p13n/ tests/ authcache_p13n.stub.inc, line 509 - Stub classes for testing.
Class
- AuthcacheP13nTestEchoSettingValidator
- Stub class for setting request validator.
Code
public function validate($params) {
$valid = !isset($params['valid']) || $params['valid'];
if (!$valid) {
throw new AuthcacheP13nRequestInvalidInput();
}
return array(
'validated' => TRUE,
) + $params;
}