Commit 92f4e321 authored by elachlan's avatar elachlan

Issue #2887225 by arunkumark, jayesh_makwana, chishah92, Sivaprasad C,...

Issue #2887225 by arunkumark, jayesh_makwana, chishah92, Sivaprasad C, elachlan: Coding Standard issues
parent 2e2029b3
......@@ -8,7 +8,7 @@ CAPTCHA module for Drupal
(https://codeclimate.com/github/chuva-inc/captcha/badges/gpa.svg)]
(https://codeclimate.com/github/chuva-inc/captcha)
DESCRIPTION
INTRODUCTION
-----------
captcha.module is the basic CAPTCHA module, offering general CAPTCHA
administration and a simple maths challenge.
......@@ -28,6 +28,10 @@ DEPENDENCIES
------------
The basic CAPTCHA module has no dependencies, nothing special is required.
REQUIREMENTS
------------
No special requirements.
CONFLICTS/KNOWN ISSUES
----------------------
CAPTCHA and page caching do not work together currently.
......
......@@ -56,7 +56,7 @@ function _image_captcha_get_enabled_fonts() {
* @return array
* List($readable_fonts, $problem_fonts).
*/
function _image_captcha_check_fonts($fonts) {
function _image_captcha_check_fonts(array $fonts) {
$readable_fonts = [];
$problem_fonts = [];
......
......@@ -157,14 +157,15 @@ class Captcha extends FormElement implements ContainerFactoryPluginInterface {
// - $element['#captcha_info'], for post processing functions that do not
// receive a $form_state argument (e.g. the pre_render callback).
// Added a new access attribute,
// by default it will be true if access attribute not defined in a custom form.
// by default it will be true if access attribute
// not defined in a custom form.
$form_state->set('captcha_info', [
'this_form_id' => $this_form_id,
'posted_form_id' => $posted_form_id,
'captcha_sid' => $captcha_sid,
'module' => $captcha_type_module,
'captcha_type' => $captcha_type_challenge,
'access' => isset($element['#access']) ? $element['#access'] : CAPTCHA_FIELD_DEFAULT_ACCESS
'access' => isset($element['#access']) ? $element['#access'] : CAPTCHA_FIELD_DEFAULT_ACCESS,
]);
$element['#captcha_info'] = [
'form_id' => $this_form_id,
......
......@@ -23,7 +23,7 @@ class CaptchaCachedSettingsSubscriber implements EventSubscriberInterface {
* CaptchaCachedSettingsSubscriber constructor.
*
* @param \Drupal\Core\Render\ElementInfoManagerInterface $elementInfo
* Constructor.
* Constructor.
*/
public function __construct(ElementInfoManagerInterface $elementInfo) {
$this->elementInfo = $elementInfo;
......
......@@ -25,7 +25,7 @@ class CaptchaExamplesForm extends FormBase {
* CaptchaExamplesForm constructor.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
* Constructor.
* Constructor.
*/
public function __construct(ModuleHandlerInterface $moduleHandler) {
$this->moduleHandler = $moduleHandler;
......
......@@ -244,7 +244,7 @@ class CaptchaSettingsForm extends ConfigFormBase {
*
* @param array $form
* Form structured array.
* @param FormStateInterface $form_state
* @param Drupal\Core\Form\FormStateInterface $form_state
* Form state structured array.
*/
public function clearCaptchaPlacementCacheSubmit(array $form, FormStateInterface $form_state) {
......
......@@ -258,7 +258,7 @@ class CaptchaAdminTestCase extends CaptchaBaseWebTestCase {
* Form machine ID.
*
* @return \Drupal\captcha\Entity\CaptchaPoint
* CaptchaPoint with mysql query result.
* CaptchaPoint with mysql query result.
*/
protected function getCaptchaPointSettingFromDatabase($form_id) {
$ids = \Drupal::entityQuery('captcha_point')
......
......@@ -241,12 +241,12 @@ class CaptchaTestCase extends CaptchaBaseWebTestCase {
$entity_form_display = EntityFormDisplay::load('user.user.default');
if (!$entity_form_display) {
$entity_form_display = EntityFormDisplay::create(array(
$entity_form_display = EntityFormDisplay::create([
'targetEntityType' => 'user',
'bundle' => 'user',
'mode' => 'default',
'status' => TRUE,
));
]);
}
$entity_form_display
......
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