Problem/Motivation

Running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig captcha shows the following errors/warnings.

FILE: /Users/vimalnadar/www/Travelopia/captcha/migrations/d7_captcha_points.yml
 18 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: /Users/vimalnadar/www/Travelopia/captcha/captcha.config_translation.yml
 5 | ERROR | [x] Expected 1 newline at end of file; 0 found

FILE: /Users/vimalnadar/www/Travelopia/captcha/tests/src/Unit/Controller/CaptchaPointListBuilderTest.php
 26 | ERROR | [x] Expected 1 blank line before function; 0 found

FILE: /Users/vimalnadar/www/Travelopia/captcha/tests/src/Functional/CaptchaCacheTest.php
 38 | WARNING | Unused global variable $base_path.

FILE: /Users/vimalnadar/www/Travelopia/captcha/image_captcha/image_captcha.module
  13 | WARNING | Global constants should not be used, move it to a class or interface
  16 | WARNING | Global constants should not be used, move it to a class or interface
  17 | WARNING | Global constants should not be used, move it to a class or interface
  18 | WARNING | Global constants should not be used, move it to a class or interface
  20 | WARNING | Global constants should not be used, move it to a class or interface
  21 | WARNING | Global constants should not be used, move it to a class or interface
  22 | WARNING | Global constants should not be used, move it to a class or interface
 224 | WARNING | Unused variable $readable_fonts.
 225 | WARNING | Unused variable $readable_fonts.

FILE: /Users/vimalnadar/www/Travelopia/captcha/image_captcha/image_captcha.routing.yml
 20 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction
 27 | WARNING | Open page callback found, please add a comment before the line why there is no access restriction

FILE: /Users/vimalnadar/www/Travelopia/captcha/image_captcha/src/Form/ImageCaptchaSettingsForm.php
 276 | WARNING | Unused variable $readable_fonts.
 281 | WARNING | Unused variable $readable_fonts.
 305 | WARNING | Unused variable $image_captcha_fonts.
 407 | WARNING | #options values usually have to run through t() for translation
 409 | WARNING | #options values usually have to run through t() for translation
 411 | WARNING | #options values usually have to run through t() for translation

FILE: /Users/vimalnadar/www/Travelopia/captcha/image_captcha/src/Controller/CaptchaImageRefresh.php
 57 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead

FILE: /Users/vimalnadar/www/Travelopia/captcha/captcha.module
  33 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  35 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  38 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  41 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  43 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  44 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  45 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  47 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  48 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  50 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  51 | WARNING | [ ] Global constants should not be used, move it to a class or interface
  54 | WARNING | [ ] Global constants should not be used, move it to a class or interface
 759 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 774 | ERROR   | [x] list(...) is forbidden, use [...] instead.
 779 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 7

FILE: /Users/vimalnadar/www/Travelopia/captcha/captcha.install
 124 | ERROR | [x] Expected 1 space before "=>"; 0 found
 124 | ERROR | [x] Expected 1 space after "=>"; 0 found
 124 | ERROR | [x] Expected 1 space before "=>"; 0 found
 124 | ERROR | [x] Expected 1 space after "=>"; 0 found
 151 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 152 | ERROR | [x] Expected 1 space(s) before asterisk; 0 found
 158 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 159 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
 159 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
 160 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 161 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 162 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 163 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
 164 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 165 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
 166 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
 166 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 3
 167 | ERROR | [x] Closing brace indented incorrectly; expected 0 spaces, found 2

FILE: /Users/vimalnadar/www/Travelopia/captcha/src/Form/CaptchaSettingsForm.php
 102 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 285 | ERROR   | [x] list(...) is forbidden, use [...] instead.
 288 | ERROR   | [ ] The array declaration extends to column 183 (the limit is 80). The array content should be split up over multiple lines
 292 | ERROR   | [ ] The array declaration extends to column 183 (the limit is 80). The array content should be split up over multiple lines

FILE: /Users/vimalnadar/www/Travelopia/captcha/src/Form/CaptchaExamplesForm.php
 77 | WARNING | Unused variable $mkey.

FILE: /Users/vimalnadar/www/Travelopia/captcha/src/Service/CaptchaService.php
 69 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead

Proposed resolution

Fix the issues reported by PHP_CodeSniffer.

Comments

vimal_nadar created an issue. See original summary.

avpaderno’s picture

Version: 8.x-1.10 » 8.x-1.x-dev
Assigned: vimal_nadar » Unassigned
Priority: Normal » Minor
avpaderno’s picture

Issue summary: View changes
anybody’s picture

Status: Active » Closed (won't fix)

No more non-security fixes in 1.x