ParagraphsWidget.php Coding check

Created on 11 June 2019, almost 6 years ago
Updated 27 February 2025, about 1 month ago

Just doing some coding standards checks looking for depreciated code and come across a few coding standards issues on this file: ParagraphsWidget.php

--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 64 ERRORS AND 18 WARNINGS AFFECTING 76 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------
  111 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
  123 | ERROR   | [x] Short array syntax must be used to define arrays
  141 | ERROR   | [x] Short array syntax must be used to define arrays
  143 | ERROR   | [x] Short array syntax must be used to define arrays
  151 | ERROR   | [x] Short array syntax must be used to define arrays
  159 | ERROR   | [x] Short array syntax must be used to define arrays
  186 | ERROR   | [x] Concat operator must be surrounded by a single space
  199 | ERROR   | [x] Concat operator must be surrounded by a single space
  204 | ERROR   | [x] Short array syntax must be used to define arrays
  213 | ERROR   | [x] Short array syntax must be used to define arrays
  222 | ERROR   | [x] Equals sign not aligned correctly; expected 1 space but found 2 spaces
  260 | ERROR   | [x] Parameter comment must end with a full stop
  266 | ERROR   | [x] Expected 1 space after SWITCH keyword; 0 found
  273 | ERROR   | [x] Case breaking statements must be followed by a single blank line
  279 | ERROR   | [x] Case breaking statements must be followed by a single blank line
  285 | ERROR   | [x] Case breaking statements must be followed by a single blank line
  293 | ERROR   | [x] Case breaking statements must be followed by a single blank line
  313 | ERROR   | [x] Short array syntax must be used to define arrays
  316 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  335 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  339 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  410 | ERROR   | [x] Short array syntax must be used to define arrays
  508 | ERROR   | [x] Short array syntax must be used to define arrays
  511 | ERROR   | [x] Short array syntax must be used to define arrays
  513 | ERROR   | [x] Short array syntax must be used to define arrays
  513 | ERROR   | [x] Short array syntax must be used to define arrays
  515 | ERROR   | [x] Short array syntax must be used to define arrays
  597 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
  623 | ERROR   | [x] Short array syntax must be used to define arrays
  638 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
  784 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
  787 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
  816 | WARNING | [x] A comma should follow the last multiline array item. Found: 'addTranslatabilityClue'
  871 | ERROR   | [x] Short array syntax must be used to define arrays
  965 | ERROR   | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
  966 | ERROR   | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
  969 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
  975 | ERROR   | [x] Short array syntax must be used to define arrays
  990 | ERROR   | [x] Short array syntax must be used to define arrays
 1035 | WARNING | [x] A comma should follow the last multiline array item. Found: 1
 1048 | ERROR   | [x] Short array syntax must be used to define arrays
 1050 | ERROR   | [x] Short array syntax must be used to define arrays
 1088 | ERROR   | [x] No space found before comment text; expected "// $elements['dragdrop_mode']['#button_type'] = 'primary';" but found
      |         |     "//$elements['dragdrop_mode']['#button_type'] = 'primary';"
 1088 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses
 1101 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 1103 | ERROR   | [x] Short array syntax must be used to define arrays
 1114 | ERROR   | [x] Short array syntax must be used to define arrays
 1116 | ERROR   | [x] Short array syntax must be used to define arrays
 1118 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 1332 | ERROR   | [x] Short array syntax must be used to define arrays
 1337 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 1347 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 1354 | ERROR   | [x] Expected 1 space after comma in function call; 2 found
 1354 | ERROR   | [x] Expected one space after the comma, 2 found
 1386 | ERROR   | [x] Return comment indentation must be 3 spaces, found 4 spaces
 1500 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 1589 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 1645 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 1654 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
 1812 | ERROR   | [x] Missing function doc comment
 1832 | ERROR   | [x] Missing function doc comment
 1867 | ERROR   | [x] Expected 1 blank line after function; 2 found
 1875 | ERROR   | [ ] Missing parameter type
 1884 | WARNING | [x] A comma should follow the last multiline array item. Found: '#parents'
 1930 | WARNING | [x] A comma should follow the last multiline array item. Found: $delta
 1947 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 1979 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 1979 | ERROR   | [x] Expected 1 space between comma and "'subform'"; 0 found
 1979 | ERROR   | [x] Expected 0 spaces between "]" and comma; 1 found
 1979 | ERROR   | [x] Expected one space after the comma, 0 found
 1985 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 2144 | ERROR   | [x] Expected 1 blank line after function; 2 found
 2178 | ERROR   | [x] Short array syntax must be used to define arrays
 2284 | ERROR   | [x] Short array syntax must be used to define arrays
 2304 | ERROR   | [ ] Missing parameter comment
 2305 | ERROR   | [ ] Missing parameter comment
 2323 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 2341 | ERROR   | [ ] Missing parameter comment
 2342 | ERROR   | [ ] Missing parameter comment
 2344 | ERROR   | [ ] Description for the @return value is missing
 2355 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 2495 | WARNING | [x] A comma should follow the last multiline array item. Found: )

I'm going to do a cleanup on it, generate a patch and manually address other issues after

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom darrenwh Bristol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

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