Fix PHPCS validation job errors

Created on 4 April 2025, 3 days ago

Problem/Motivation

Latest build pipeline on 2.x completes with validation errors reported by the PHPCS job on Gitlab CI, see:
Build: https://git.drupalcode.org/project/structure_sync/-/pipelines/465915
PHPCS Errors: https://git.drupalcode.org/project/structure_sync/-/jobs/4876931

Steps to reproduce

Run build pipeline on the 2.x branch at:
https://git.drupalcode.org/project/structure_sync/-/pipelines/new

Proposed resolution

Fix all reported PHPCS errors either automatically with phpcbf, or manually.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France dydave

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

Comments & Activities

  • Issue created by @dydave
  • @dydave opened merge request.
  • 🇫🇷France dydave

    Quick follow-up on this issue:

    Created initial MR!46 above at #2 which fixes all PHPCS errors.

    I just executed locally automated fixes with phpcbf and all the errors were fixed.
    Most of the errors where just a missing nullable operator on some of the variables Type declarations, see the merge request for the detailed changes.

    Since all Tests are now passing 🟢, moving to Needs review and bumping to Major: This issue is preventing other merge requests from being properly tested.
    Additionally, we are unable to know whether pending merge requests could be introducing Coding Standards errors.

    We would greatly appreciate if a maintainer with write access could take a look at the merge request and let us know if any more work would be needed.

    Thanks in advance!

  • 🇨🇦Canada mparker17 UTC-4

    @dydave, thank you very much, but I cannot apply these changes without dropping support for Drupal 8 (the ?type syntax was introduced in PHP 7.1; but Drupal 8 requires PHP 7.0). Dropping support for D8 would be a backwards-compatibility break.

    I've filed a ticket to discuss this, Drop support for D8, D9, D10.0-10.3 Active - please weigh in there :)

    I'm marking this ticket as a duplicate of that one.

Production build 0.71.5 2024