Problem/Motivation

PHPStan job fails with the follow error.

Read-only properties are incompatible with Drupal\Core\DependencyInjection\DependencySerializationTrait when the trait is used by a parent class on PHP < 8.4.

Proposed resolution

Since Drupal\Core\DependencyInjection\DependencySerializationTrait is used by a parent class in most of the cases, read-only properties should not be used in classes that use that trait. That could be changed once Drupal core require PHP 8.5 which should happen in Drupal 12.

Issue fork examples-3614423

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

avpaderno created an issue. See original summary.

avpaderno’s picture

Assigned: Unassigned » avpaderno

avpaderno’s picture

Status: Active » Needs review

  • avpaderno committed 9cce2c4c on 5.0.x
    Issue #3614423: "Read-only properties are incompatible with Drupal\Core\...
avpaderno’s picture

Assigned: avpaderno » Unassigned

  • avpaderno committed 6aa95662 on main
    Issue #3614423: "Read-only properties are incompatible with Drupal\Core\...
avpaderno’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

avpaderno’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.