Fix PHP deprecations

Created on 30 April 2025, 19 days ago

Problem/Motivation

Currently I am working on Allow configs to be enforced by default Active and blocked there because the PHPUnit tests are failing due to PHP deprecations:

https://git.drupalcode.org/issue/config_enforce_devel-3518869/-/jobs/511...

There were 2 errors:
1) Drupal\Tests\config_enforce_devel\Functional\EnforceConfigByDefaultTest::testEnforceConfigByDefault
Exception: Deprecated function: Creation of dynamic property Drupal\config_enforce_devel\TargetModuleInstaller::$moduleHandler is deprecated
...
2) Drupal\Tests\config_enforce_devel\Functional\ThemeSettingsFormTest::testThemeSettingsFormSubmit
Exception: Deprecated function: Creation of dynamic property Drupal\config_enforce_devel\TargetModuleInstaller::$moduleHandler is deprecated

Steps to reproduce

Run the new PHPUnit test added in Allow configs to be enforced by default Active .

Proposed resolution

The right thing to do here seems to be to use phpstan and get that passing, otherwise I think we risk missing other deprecations.

phpstan from that same branch: https://git.drupalcode.org/issue/config_enforce_devel-3518869/-/jobs/511...

Remaining tasks

  1. Inventory phpstan errors
  2. Estimate effort to resolve them
  3. Fix all/most phpstan errors
  4. Create merge request

User interface changes

n/a

API changes

n/a

Data model changes

n/a

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada star-szr

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

Comments & Activities

Production build 0.71.5 2024