Fix the issues reported by phpcs

Created on 7 July 2023, 12 months ago
Updated 10 January 2024, 6 months ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\block_title_link\block_title_link.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  47 | WARNING | [x] A comma should follow the last multiline array item. Found: FALSE
 105 | ERROR   | [x] Doc comment short description must end with a full stop
 107 | ERROR   | [ ] Invalid function name, expected get_uri_as_displayable_string but found getUriAsDisplayableString
 107 | ERROR   | [ ] All functions defined in a module file must be prefixed with the module's name, found "getUriAsDisplayableString" but expected "block_title_link_getUriAsDisplayableString"
 128 | ERROR   | [x] list(...) is forbidden, use [...] instead.
 131 | ERROR   | [x] Comment indentation error after @todo element, expected 3 spaces
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 835ms; Memory: 6MB

Steps to reproduce

Command used: C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig block_title_link

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: duplicate

Version

1.1

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

Comments & Activities

  • Issue created by @sidharth_soman
  • Issue was unassigned.
  • Status changed to Needs review 12 months ago
  • 🇮🇳India sidharth_soman Bangalore

    I've fixed all the issues except for the invalid function name with getUriAsDisplayableString(). This is definitely a false negative since it's obviously a helper function and hence doesn't need to have the name of the module prefixed to it.

    Please review the uploaded patch.

  • Status changed to Closed: duplicate 6 months ago
  • 🇹🇭Thailand Nick Hope

    These issues are also fixed in https://www.drupal.org/project/block_title_link/issues/3285695 🐛 Deprecated function: parse_url(): RTBC , which primarily fixes a deprecated function error. So I'm closing this issue in favor of that one.

Production build 0.69.0 2024