Commit f6c89e88 authored by minakshiPh's avatar minakshiPh Committed by elachlan

Issue #2798991 by minakshiPh, naveenvalecha, shruti1803, rasikap, keshav.k,...

Issue #2798991 by minakshiPh, naveenvalecha, shruti1803, rasikap, keshav.k, Yogesh Pawar: Fix coding standards & replace the deprecated methods
parent 173a3fe0
......@@ -447,7 +447,7 @@ function captcha_validate($element, FormStateInterface &$form_state) {
// Update wrong response counter.
if (\Drupal::config('captcha.settings')->get('enable_stats', FALSE)) {
Drupal::state()->set('captcha.wrong_response_counter', Drupal::state()
->get('captcha.wrong_response_counter', 0) + 1);
->get('captcha.wrong_response_counter', 0) + 1);
}
if (\Drupal::config('captcha.settings')
......
......@@ -35,7 +35,7 @@ class CaptchaExamplesForm extends FormBase {
else {
// Generate a list with examples of the available CAPTCHA types.
$form['info'] = [
'#markup' => t('This page gives an overview of all available challenge types, generated with their current settings.'),
'#markup' => $this->t('This page gives an overview of all available challenge types, generated with their current settings.'),
];
foreach (\Drupal::moduleHandler()
->getImplementations('captcha') as $mkey => $module) {
......@@ -45,13 +45,13 @@ class CaptchaExamplesForm extends FormBase {
foreach ($challenges as $ckey => $challenge) {
$form["captcha_{$mkey}_{$ckey}"] = [
'#type' => 'details',
'#title' => t('Challenge %challenge by module %module', [
'#title' => $this->t('Challenge %challenge by module %module', [
'%challenge' => $challenge,
'%module' => $module,
]),
'challenge' => _captcha_generate_example_challenge($module, $challenge),
'more_examples' => [
'#markup' => Link::fromTextAndUrl(t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [
'#markup' => Link::fromTextAndUrl($this->t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [
'module' => $module,
'challenge' => $challenge,
]))->toString(),
......
......@@ -48,8 +48,8 @@ class CaptchaPointForm extends EntityForm {
// Select widget for CAPTCHA type.
$form['captchaType'] = [
'#type' => 'select',
'#title' => t('Challenge type'),
'#description' => t('The CAPTCHA type to use for this form.'),
'#title' => $this->t('Challenge type'),
'#description' => $this->t('The CAPTCHA type to use for this form.'),
'#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings')
->get('default_challenge')),
'#options' => _captcha_available_challenge_types(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment