PHPCS issue arising from hook_help()

Created on 29 April 2025, about 8 hours ago

Problem/Motivation

There are some PHPCS errors:

FILE: /var/www/html/web/modules/custom/access_by_ref/access_by_ref.module
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------
 26 | ERROR   | String concat is not required here; use a single string instead (Drupal.Strings.UnnecessaryStringConcat.Found)
 27 | ERROR   | String concat is not required here; use a single string instead (Drupal.Strings.UnnecessaryStringConcat.Found)
 28 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead (Drupal.Semantics.FunctionT.BackslashSingleQuote)
 29 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead (Drupal.Semantics.FunctionT.BackslashSingleQuote)
--------------------------------------------------------------------------------------------------------------------------------------------------------

This was introduced by MR !8 of 📌 Implement hook_help() Active , which was opened against the 3.x branch. It looks like the commit was merged directly into the 4.0 branch, which skipped the pipeline.

Steps to reproduce

See pipeline: https://git.drupalcode.org/project/access_by_ref/-/jobs/5090465

Proposed resolution

The changes to fix this are all very simple.

This would be a good issue for a novice developer.

Remaining tasks

In the access_by_ref.module file, in access_by_ref_help:

  • Combine '<ol>' and '<li>' into a single string (lines 26-27).
  • Change the strings containing \' (in user\'s) to be surrounded by double quotes ("), and remove the backslash from the single quote.
  • Combine '</li>' and '</ol>' into a single string.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Comments & Activities

Production build 0.71.5 2024