Address PHPCS error messages

Created on 29 October 2024, about 2 months ago

Problem/Motivation

The current main branch 2.0.x has a gitlab pipeline that uses the PHPCS tool to find problems in this repository's coding style. At the moment the tool is being ignored.

Steps to reproduce

Go to https://git.drupalcode.org/project/config_snapshot/-/jobs/2780334
See

$ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source $_PHPCS_EXTRA
FILE: ...t/web/modules/custom/config_snapshot/src/ConfigSnapshotServiceProvider.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
 46 | ERROR   | [x] Expected newline after closing brace
    |         |     (Drupal.ControlStructures.ControlSignature.NewlineAfterCloseBrace)
 47 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
    |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 51 | ERROR   | [x] Expected newline after closing brace
    |         |     (Drupal.ControlStructures.ControlSignature.NewlineAfterCloseBrace)
 52 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
    |         |     (Drupal.Files.LineLength.TooLong)
 52 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks,
    |         |     question marks, colons, or closing parentheses
    |         |     (Drupal.Commenting.InlineComment.InvalidEndChar)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 157ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...ustom/config_snapshot/src/ConfigSnapshotServiceProvider.php  4       1
--------------------------------------------------------------------------------
A TOTAL OF 4 ERRORS AND 1 WARNING WERE FOUND IN 7 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 4 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
---------------------------------------------------------------------------
    SOURCE                                                            COUNT
---------------------------------------------------------------------------
[x] Drupal.Commenting.InlineComment.InvalidEndChar                    2
[x] Drupal.ControlStructures.ControlSignature.NewlineAfterCloseBrace  2
[ ] Drupal.Files.LineLength.TooLong                                   1
---------------------------------------------------------------------------
A TOTAL OF 5 SNIFF VIOLATIONS WERE FOUND IN 3 SOURCES
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SOURCES AUTOMATICALLY (4 VIOLATIONS IN TOTAL)
---------------------------------------------------------------------------

Proposed resolution

Address the CODE SNIFFER VIOLATIONs

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024