Fix the issues reported by phpcs

Created on 31 May 2023, about 1 year ago
Updated 28 June 2023, about 1 year ago

Problem/Motivation

Found this issues reported by phpcs:

FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/siteimprove.module
-------------------------------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 5 WARNINGS AFFECTING 19 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  26 | ERROR   | [x] No space found before comment text; expected "// In event node parameter is not a node object." but found "//In event node parameter is not a node object."
  41 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
  42 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
  44 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
  48 | ERROR   | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
  87 | ERROR   | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
  95 | WARNING | [x] A comma should follow the last multiline array item. Found: 'entity.taxonomy_term.edit_form'
 113 | ERROR   | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
 134 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 147 | ERROR   | [ ] Description for the @return value is missing
 167 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 181 | ERROR   | [x] Empty array declaration must have no space between the parentheses
 183 | ERROR   | [x] Empty array declaration must have no space between the parentheses
 184 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 244 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 251 | WARNING | [x] A comma should follow the last multiline array item. Found: 'entity.taxonomy_term.edit_form'
 266 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
 270 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
 283 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/css/siteimprove.settings.css
-----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
 16 | ERROR | [x] Expected 1 newline at end of file; 2 found
 17 | ERROR | [x] Additional whitespace found at end of file
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/siteimprove_domain_access/siteimprove_domain_access.module
-----------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------------
 20 | WARNING | Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
-----------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/siteimprove.install
--------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------
 45 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 58 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/src/Form/SettingsForm.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------
 368 | WARNING | Unused variable $res.
--------------------------------------------------------------------------------------------------------------------


FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/siteimprove/src/SiteimproveUtils.php
-------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------
 150 | ERROR | [ ] Missing parameter type
 152 | ERROR | [x] Separate the @param and @return sections by a blank line.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

Time: 575ms; Memory: 12MB

Steps to reproduce

Run this command in the module folder: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml

Proposed resolution

Remaining tasks

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡΅πŸ‡­Philippines paraderojether

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

Comments & Activities

Production build 0.69.0 2024