Fix the issues reported by phpcs

Created on 4 May 2023, over 1 year ago
Updated 9 June 2024, 6 months ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\label_help\label_help.module
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AND 6 WARNINGS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] Missing file doc comment
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  32 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  35 | WARNING | [ ] Unused variable $form_entity_get_field_definition_method.
  43 | WARNING | [ ] Unused variable $theme_option.
  43 | ERROR   | [x] Short array syntax must be used to define arrays
  50 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
  52 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
  54 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
  70 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 0
  70 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
  71 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  71 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 0
  71 | ERROR   | [ ] Comment indentation error, expected only 8 spaces
  72 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 0
  72 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  89 | ERROR   | [x] Short array syntax must be used to define arrays
 104 | ERROR   | [ ] The array declaration extends to column 133 (the limit is 80). The array content should be split up over multiple lines
 117 | ERROR   | [x] Inline comments must start with a capital letter
 117 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 127 | ERROR   | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command
phpcs --standard=โ€œDrupal,DrupalPracticeโ€ --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

๐Ÿ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024