Ignore MissingTrailingComma for old version

Created on 24 May 2024, 4 months ago
Updated 25 June 2024, 3 months ago

Problem/Motivation

phpcs is reporting errors on the code but this branch is still D9 compatible, and this suggestion is not:

FILE: ...odules/custom/cas_server/tests/src/Unit/TestTicketValidationController.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
22 | ERROR | [x] Multi-line function declarations must have a trailing comma
| | after the last parameter
| | (Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

Steps to reproduce

Run a pipeline on the 2.0.x branch which is also testing D9. This will be dropped at some point but right now it's throwing errors and we'll need tests running in a bit for this branch.

Proposed resolution

Ignore the error using a similar construct to this:

<?php
/**
 * @phpcs:disable Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma
 */
public function blah(
  string $this,
  int $terrupt 
) {
  // phpcs:enable
}
?>

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ✅ Automated unit testing coverage
  • ✅ Release notes snippet
  • ❌ Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia elc

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