Fix PHPStan for previous major

Created on 1 November 2025, 3 days ago

Problem/Motivation

🐛 Recent commits to *.3.x branches break BC Active fixed some compatibility issues for 10.x under the 3.3.x branch. However, there are some outstanding PHPStan warnings that weren't blockers, but should be fixed.

Steps to reproduce

See pipeline for

phpstan (previous major)</code).

<h3 id="summary-proposed-resolution">Proposed resolution</h3>

Some of the issues can be fixed with a before_script, to remove the attributes before phpstan (previous major) runs:
<code>
phpstan (previous major):
  before_script:
    - if [[ "$DRUPAL_CORE" =~ ^10 ]]; then
    -   sed -i '/#\[Legacy.*\]/d' $DRUPAL_PROJECT_FOLDER/*.module $DRUPAL_PROJECT_FOLDER/*.inc $DRUPAL_PROJECT_FOLDER/modules/*/*.module $DRUPAL_PROJECT_FOLDER/tests/modules/*/*.module
    -   sed -i '/^.*#\[\(Hook\)\(.*\)\].*$/d' $DRUPAL_PROJECT_FOLDER/src/Hook/*.php $DRUPAL_PROJECT_FOLDER/modules/*/src/Hook/*.php $DRUPAL_PROJECT_FOLDER/tests/modules/*/src/Hook/*.php
    - fi

There are some other problems that will need further investigation.

Remaining tasks

  1. Investigate other warnings.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Needs work

Version

3.3

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024